Fix possible NPE in SCLExpressionIssueProvider 29/1329/1
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 20 Dec 2017 06:34:26 +0000 (08:34 +0200)
committerjsimomaa <jani.simomaa@gmail.com>
Wed, 20 Dec 2017 06:34:26 +0000 (08:34 +0200)
refs #7689

Change-Id: If7c4cad3b5ae238d90dd03e1d40f2aec2f597276

bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java

index fbba1546ffbc2a0e81a75c95bea69c6e290b9584..7e480d4ffa1218276448b00fbcf8a64e48cebdec 100644 (file)
@@ -145,7 +145,11 @@ public class SCLExpressionIssueProvider implements SCLIssueProvider {
             if (!graph.hasStatement(parameter))
                 return null;
             
-            Variable componentVariable = Variables.getVariable(graph, parameter);
+            Variable componentVariable = Variables.getPossibleVariable(graph, parameter);
+            if (componentVariable == null) {
+                // Resource might be deleted already and therefore no URI available for variable building
+                return null;
+            }
             Variable propertyVariable = componentVariable.getProperty(graph, parameter2);
             
             Variable typeVariable = Variables.getVariable(graph, type);