From: Tuukka Lehtonen Date: Fri, 14 Sep 2018 13:15:00 +0000 (+0300) Subject: Added null check for getPossibleObject return value X-Git-Tag: v1.43.0~136^2~374 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=ad5b573b5db77a3e00429fc24e2de855bce7f48a Added null check for getPossibleObject return value gitlab #124 Change-Id: Ia5deaafddd4f15c25351feed19d32b4634349544 (cherry picked from commit 74083d12acc3169cbeb36f39b3f4837ffdc34233) --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java index 7c1fe461a..8a0b1ddbc 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java @@ -459,6 +459,8 @@ public class SyncTypicalTemplatesToInstances extends WriteRequest { private boolean isSynchronizedConnector(ReadGraph graph, Resource templateConnection, Resource instanceConnector) throws DatabaseException { DiagramResource DIA = DiagramResource.getInstance(graph); Resource instanceConnection = graph.getPossibleObject(instanceConnector, DIA.IsConnectorOf); + if (instanceConnection == null) + return false; return graph.hasStatement(instanceConnection, MOD.HasElementSource, templateConnection) // If the master connection has been removed, this is all that's left // to identify a connection that at least was originally synchronized