From 4feca5401b12b8b49cb7813753f54969c8b799bc Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 27 May 2010 14:27:17 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@15964 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/dependencies/CreateDependencyGraph.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java index 2d6f5e00..ea278090 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/dependencies/CreateDependencyGraph.java @@ -23,13 +23,13 @@ public class CreateDependencyGraph implements Read { public CreateDependencyGraph(Resource root, int levels, boolean isInverted) { this.root = root; - this.nodes = new HashMap(); this.isInverted = isInverted; this.levels = levels; } @Override public Graph perform(ReadGraph g) throws DatabaseException { + nodes = new HashMap(); Graph graph = new Graph(); graph.setRankdir("LR"); if (g.isInstanceOf(root, SysdynResource.getInstance(g).IndependentVariable)) { @@ -67,7 +67,9 @@ public class CreateDependencyGraph implements Read { Collection dependencies = g.getObjects(r, headRelation); Collection dependants = new ArrayList(); for(Resource d : dependencies) { - Resource dependant = g.getSingleObject(d, tailRelation); + Resource dependant = g.getPossibleObject(d, tailRelation); + if(dependant == null) + continue; if(!g.isInstanceOf(dependant, sr.IndependentVariable)) { break; } -- 2.47.1