From b9d79cf838dc96986d73abd721ab627935fd66cc Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 7 Mar 2018 12:50:28 +0200 Subject: [PATCH] Fixed yet another potential NPE. refs #7800 Change-Id: Ia6f45c5f3b5c32845bb486062fe46e10fe8cffe2 --- .../src/org/simantics/db/layer0/function/All.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.43.2