]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Prevent NPE in InvertBasicExpressionVisitor 52/1152/3
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 27 Oct 2017 22:31:27 +0000 (01:31 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 27 Oct 2017 23:23:48 +0000 (02:23 +0300)
More specifically in method
possibleInvertibleExpressionReferencedProperty

refs #7582

Change-Id: Idf03985905b6b39ce74f885bab41eee3d14e552f

bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java

index dac192936285bed1bd6049e1a53527867ac7abbf..11351f06b6a2cf64d05f5e5b2228e5781bd2f617 100644 (file)
@@ -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<Double, Double, String> data = (Triple<Double, Double, String>)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;
         }