From 60652a89994f8050111b5c243323f6ed703c929a Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sat, 28 Oct 2017 01:31:27 +0300 Subject: [PATCH] Prevent NPE in InvertBasicExpressionVisitor More specifically in method possibleInvertibleExpressionReferencedProperty refs #7582 Change-Id: Idf03985905b6b39ce74f885bab41eee3d14e552f --- .../org/simantics/modeling/InvertBasicExpressionVisitor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.1