From: jsimomaa Date: Wed, 20 Dec 2017 06:34:26 +0000 (+0200) Subject: Fix possible NPE in SCLExpressionIssueProvider X-Git-Tag: v1.43.0~136^2~651 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=fccc8f9d20c8fbb4ac8e601aa1fcfcc1e0075cab;p=simantics%2Fplatform.git Fix possible NPE in SCLExpressionIssueProvider refs #7689 Change-Id: If7c4cad3b5ae238d90dd03e1d40f2aec2f597276 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java index fbba1546f..7e480d4ff 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/issue/SCLExpressionIssueProvider.java @@ -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);