]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Graph debugger: handle case where assertions does not have predicate
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 2 Jul 2018 09:24:27 +0000 (12:24 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 2 Jul 2018 09:24:27 +0000 (12:24 +0300)
gitlab #38

Change-Id: I85b9b2c014b44bcaec7cf3117b87df1215143435

bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java

index b51ed4d000ca0b2b8aa6a889546a0fa93950c93d..c3b3ab8b94792ea4dc12942eae7455ed26568d91 100644 (file)
@@ -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);