From: Hannu Niemistö Date: Mon, 2 Jul 2018 09:24:27 +0000 (+0300) Subject: Graph debugger: handle case where assertions does not have predicate X-Git-Tag: v1.43.0~136^2~447 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=34d0a75321b7f7d139fe101ccae5d0538b04408e;p=simantics%2Fplatform.git Graph debugger: handle case where assertions does not have predicate gitlab #38 Change-Id: I85b9b2c014b44bcaec7cf3117b87df1215143435 --- diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java index b51ed4d00..c3b3ab8b9 100644 --- a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java +++ b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java @@ -952,11 +952,11 @@ public class GraphDebugger extends Composite { try { Layer0 L0 = Layer0.getInstance(graph); if (graph.isInstanceOf(r, L0.Assertion)) { - Resource pred = graph.getSingleObject(r, L0.HasPredicate); + Resource pred = graph.getPossibleObject(r, L0.HasPredicate); // Don't know how I encountered this but it seems to be possible in some cases.. // Resource obj = graph.getSingleObject(r, L0.HasObject); Resource obj = graph.getPossibleObject(r, L0.HasObject); - String tmp = htmlEscape( getResourceName(graph, pred) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" ); + String tmp = htmlEscape( (pred == null ? "No predicate ?" : getResourceName(graph, pred)) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" ); name = tmp.substring(0, Math.min(80, tmp.length())); } else { String resourceName = getResourceName(graph, r);