Project

General

Profile

Revision ab71093a

IDab71093ad501ca1f7df55f01a6cc381c9042037c
Parent 9092e20b
Child e00917d5

Added by Patrick Plitzner about 2 years ago

ref #7887 Fix possible NPE when dropping on same term

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermDropAdapterE4.java
23 23
import eu.etaxonomy.cdm.persistence.dto.TermDto;
24 24
import eu.etaxonomy.taxeditor.editor.definedterm.operation.MoveDefinedTermOperation;
25 25
import eu.etaxonomy.taxeditor.model.AbstractUtility;
26
import eu.etaxonomy.taxeditor.model.MessagingUtils;
26 27
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
27 28
import eu.etaxonomy.taxeditor.store.StoreUtil;
28 29
import eu.etaxonomy.taxeditor.ui.EditViewerDropAdapter;
......
60 61
		    TermDto term = (TermDto) droppedTerm;
61 62
			sourceTerms.add(term);
62 63
		}
63

  
64
        // cannot drop a feature node onto itself
65
        for (Object droppedObject : sourceTerms) {
66
            if(droppedObject==null){
67
                MessagingUtils.warningDialog("Move failed", this.getClass(),
68
                        "Moving the feature node failed. Try saving before.");
69
                return false;
70
            }
71
            if (droppedObject.equals(target)) {
72
                return false;
73
            }
74
        }
64 75
		AbstractPostOperation operation = new MoveDefinedTermOperation("Move Descriptions",
65 76
		        StoreUtil.getUndoContext(),
66 77
		        target,

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)