Project

General

Profile

« Previous | Next » 

Revision 64dd32e9

Added by Katja Luther over 3 years ago

avoid NPE when using new node as parent for d&d

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDtoDropAdapter.java
37 37
import eu.etaxonomy.taxeditor.featuretree.e4.operation.MoveFeatureOperation;
38 38
import eu.etaxonomy.taxeditor.l10n.Messages;
39 39
import eu.etaxonomy.taxeditor.model.MessagingUtils;
40
import eu.etaxonomy.taxeditor.store.StoreUtil;
41 40
import eu.etaxonomy.taxeditor.ui.dialog.selection.TermVocabularySelectionDialog;
42 41
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
43 42

  
......
133 132
                }
134 133
		    }
135 134
		    if(droppedObject instanceof TermNodeDto){
136
		        if (((TermNodeDto)droppedObject).getUuid() == null){
137
		            if(StoreUtil.promptCheckIsDirty(editor)){
138
		                return false;
139
		            }
135
		        if (((TermNodeDto)droppedObject).getUuid() == null || target.getUuid() == null){
136
		            MessagingUtils.warningDialog("The new imported node needs to be saved first", this, "Newly created nodes can not be moved or used as parent without saving");
137
		            return false;
140 138
		        }
141 139
		    	TermNodeDto droppedNode = editor.getNodeDtoForUuid(((TermNodeDto) droppedObject).getUuid());
142 140
		        TermNodeDto oldParent = editor.getNodeDtoForUuid(droppedNode.getParentUuid());

Also available in: Unified diff