]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Added null check for getPossibleObject return value 93/2193/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 14 Sep 2018 13:15:00 +0000 (16:15 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 14 Sep 2018 13:17:17 +0000 (13:17 +0000)
gitlab #124

Change-Id: Ia5deaafddd4f15c25351feed19d32b4634349544
(cherry picked from commit 74083d12acc3169cbeb36f39b3f4837ffdc34233)

bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java

index 7c1fe461a5e14218991f87224c8ec1d47e42a16e..8a0b1ddbca77e0f81fd283d8445c715e8c2e5adb 100644 (file)
@@ -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