Commit da8e9a4a authored by Simon Barner's avatar Simon Barner
Browse files

Fix NPE

refs 2663
parent ad7636a8
......@@ -50,16 +50,22 @@ public final class MemoryCompositor extends MemoryUnitCompositorBase<Memory> {
/** Returns whether the given contained element is of an acceptable class. */
@Override
protected boolean isCorrectElementClass(Memory container, IArchitectureDomain contained) {
// Determine if element can be added, i.e. whether current drag&drop operation
// can be finished.
return
// Elements from the next (more fine-grained) level, that can be dropped into
// the model element under the regime of this compositor
(getPlatformCompositionRules().isValidContainer(container.getClass(), contained.getClass()) && (canBeDroppedInto(contained) || canBeAddedAtCurrentLevel(contained))) ||
if(container != null) {
// Determine if element can be added, i.e. whether current drag&drop operation
// can be finished.
return
// Elements from the next (more fine-grained) level, that can be dropped into
// the model element under the regime of this compositor
(getPlatformCompositionRules().isValidContainer(container.getClass(),
contained.getClass()) && (canBeDroppedInto(contained) || canBeAddedAtCurrentLevel(contained))) ||
// Elements from the same level as the model element
// under the regime of this compositor that can be added
(getPlatformCompositionRules().hasEqualLevel(container.getClass(),
contained.getClass()) && canBeAddedAtCurrentLevel(contained));
// Elements from the same level as the model element
// under the regime of this compositor that can be added
(getPlatformCompositionRules().hasEqualLevel(container.getClass(),
contained.getClass()) && canBeAddedAtCurrentLevel(contained));
}
// Determine if element is contributed to current library.
return isAvailableInLibrary(contained);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment