Revision b9879b5e
Added by Patrick Plitzner about 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/operation/ChangeDescriptionElementType.java | ||
---|---|---|
14 | 14 |
import org.eclipse.core.runtime.IAdaptable; |
15 | 15 |
import org.eclipse.core.runtime.IProgressMonitor; |
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 |
import org.eclipse.core.runtime.Status; |
|
18 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
19 |
import org.eclipse.swt.widgets.Display; |
|
17 | 20 |
|
18 | 21 |
import eu.etaxonomy.cdm.model.description.CategoricalData; |
19 | 22 |
import eu.etaxonomy.cdm.model.description.CommonTaxonName; |
... | ... | |
91 | 94 |
destinationElement = TextData.NewInstance(); |
92 | 95 |
} |
93 | 96 |
} |
94 |
|
|
97 |
if(destinationElement==null){ |
|
98 |
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Change not possible", "Feature does not have another type"); |
|
99 |
return Status.CANCEL_STATUS; |
|
100 |
} |
|
95 | 101 |
destinationElement.setFeature(feature); |
96 | 102 |
inDescription.addElement(destinationElement); |
97 | 103 |
inDescription.removeElement(sourceElement); |
Also available in: Unified diff
Fix potential NPE #5565