@Override
public boolean performDrop(Object data) {
+ if (data == null){
+ return false;
+ }
Object currentTarget = getCurrentTarget();
TermNodeDto target = null;
if(currentTarget instanceof TermTreeDto){
else if(currentTarget instanceof TermNodeDto){
target = (TermNodeDto) currentTarget;
}
-
+
int position = 0;
int location = getCurrentLocation();
UUID parentUuid = target.getParentUuid();
if(parentUuid!=null){
TermNodeDto parent = editor.getNodeDtoForUuid(parentUuid);
+ if (parent == null){
+ MessagingUtils.warningDialog("The new node needs to be saved first", this, "Newly created nodes can not be moved or used as parent without saving");
+ return false;
+ }
if (location == LOCATION_BEFORE) {
position = Math.max(0, parent.getIndex(target));
target = parent;