Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2018-06-04 09:22:34 -0400
committerNicolas FAUVERGUE2018-06-04 10:02:47 -0400
commitdb58f7f654e9e175c1ef6fad69fd325c382cd846 (patch)
tree2186f8d6e5c22a56b97173ef5f2bda7c9d375454
parent5a5a12f6fd678351ac3f1155399d666f68fd17f2 (diff)
downloadorg.eclipse.papyrus-db58f7f654e9e175c1ef6fad69fd325c382cd846.tar.gz
org.eclipse.papyrus-db58f7f654e9e175c1ef6fad69fd325c382cd846.tar.xz
org.eclipse.papyrus-db58f7f654e9e175c1ef6fad69fd325c382cd846.zip
Remove some possible NPE in sequence diagram.
Change-Id: I4655aa8134727ecba4b24d1ec8712c08393f1aa6 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionInteractionCompartmentEditPart.java8
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateNodeReferenceEditPolicy.java3
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionInteractionCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionInteractionCompartmentEditPart.java
index 841c7ee5fc6..c01a4122f97 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionInteractionCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/parts/CInteractionInteractionCompartmentEditPart.java
@@ -63,9 +63,11 @@ public class CInteractionInteractionCompartmentEditPart extends InteractionInter
// ExecutionSpecification can't be drop into Interaction
if (request instanceof ChangeBoundsRequest) {
List<?> editParts = ((ChangeBoundsRequest) request).getEditParts();
- for (Object part : editParts) {
- if (part instanceof AbstractExecutionSpecificationEditPart) {
- return UnexecutableCommand.INSTANCE;
+ if(null != editParts && !editParts.isEmpty()) {
+ for (Object part : editParts) {
+ if (part instanceof AbstractExecutionSpecificationEditPart) {
+ return UnexecutableCommand.INSTANCE;
+ }
}
}
}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateNodeReferenceEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateNodeReferenceEditPolicy.java
index 598cdf3142b..1b7251d1280 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateNodeReferenceEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence/custom-src/org/eclipse/papyrus/uml/diagram/sequence/edit/policies/UpdateNodeReferenceEditPolicy.java
@@ -125,6 +125,9 @@ public class UpdateNodeReferenceEditPolicy extends GraphicalEditPolicy {
} else if (request instanceof ChangeBoundsRequest && (!org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_AUTOSIZE.equals(request.getType()))) {
final ChangeBoundsRequest initialChangeBoundsRequest = (ChangeBoundsRequest) request;
+ if(null == initialChangeBoundsRequest.getEditParts() || initialChangeBoundsRequest.getEditParts().isEmpty()) {
+ return UnexecutableCommand.INSTANCE;
+ }
final Iterator<?> editParts = initialChangeBoundsRequest.getEditParts().iterator();
// The reparent of execution specification in another life line is not allowed

Back to the top