From: Tuukka Lehtonen Date: Fri, 27 Oct 2017 22:31:27 +0000 (+0300) Subject: Prevent NPE in InvertBasicExpressionVisitor X-Git-Tag: v1.31.0~90 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=60652a89994f8050111b5c243323f6ed703c929a;p=simantics%2Fplatform.git Prevent NPE in InvertBasicExpressionVisitor More specifically in method possibleInvertibleExpressionReferencedProperty refs #7582 Change-Id: Idf03985905b6b39ce74f885bab41eee3d14e552f --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java index dac192936..11351f06b 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java @@ -1,7 +1,5 @@ package org.simantics.modeling; -import gnu.trove.map.hash.THashMap; - import java.util.Stack; import org.simantics.basicexpression.Expressions; @@ -210,6 +208,8 @@ public class InvertBasicExpressionVisitor extends DepthFirstAdapter { Triple data = (Triple)pair; String key = data.third.replace(MAGIC,"."); String path = getVariablePath(graph, base, key); + if (path == null) + return null; Variable targetVariable = base.browsePossible(graph, path); return targetVariable; }