From: Tuukka Lehtonen Date: Wed, 7 Mar 2018 10:50:28 +0000 (+0200) Subject: Fixed yet another potential NPE. X-Git-Tag: v1.43.0~136^2~561 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=b9d79cf838dc96986d73abd721ab627935fd66cc;p=simantics%2Fplatform.git Fixed yet another potential NPE. refs #7800 Change-Id: Ia6f45c5f3b5c32845bb486062fe46e10fe8cffe2 --- diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java index 604faa69e..84cefe37f 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java @@ -609,7 +609,7 @@ public class All { Variable parent = context.getParent(graph); Resource container = parent.getPossibleRepresents(graph); if(container == null) - return null; + return null; Map methods = graph.syncRequest(new UnescapedMethodMapOfResource(container)); Resource predicate = methods.get(name); if(predicate != null) { @@ -625,6 +625,8 @@ public class All { public Map getVariables(ReadGraph graph, Variable context, Map map) throws DatabaseException { Variable parent = context.getParent(graph); Resource container = parent.getPossibleRepresents(graph); + if(container == null) + return Collections.emptyMap(); Map methods = graph.syncRequest(new UnescapedMethodMapOfResource(container)); for(Map.Entry entry : methods.entrySet()) { String name = entry.getKey();