Revision 6959d272
Added by Patrick Plitzner about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureNodeDropAdapter.java | ||
---|---|---|
60 | 60 |
if (target != null) { |
61 | 61 |
int location = getCurrentLocation(); |
62 | 62 |
FeatureNode parent = target.getParent(); |
63 |
if (location == LOCATION_BEFORE) { |
|
64 |
position = Math.max(0, parent.getIndex(target) - 1); |
|
65 |
target = parent; |
|
66 |
} |
|
63 |
if(parent!=null){ |
|
64 |
if (location == LOCATION_BEFORE) { |
|
65 |
position = Math.max(0, parent.getIndex(target) - 1); |
|
66 |
target = parent; |
|
67 |
} |
|
67 | 68 |
|
68 |
if (location == LOCATION_AFTER) { |
|
69 |
position = parent.getIndex(target); |
|
70 |
target = parent; |
|
69 |
if (location == LOCATION_AFTER) { |
|
70 |
position = parent.getIndex(target); |
|
71 |
target = parent; |
|
72 |
} |
|
71 | 73 |
} |
72 | 74 |
} |
73 | 75 |
|
Also available in: Unified diff
Fix possible NPE