|
@@ -268,13 +268,21 @@ public class LoadController {
|
|
|
}
|
|
|
// if its stored before on the canvas just put it there
|
|
|
if (temp.getSav().equals("CVS")) {
|
|
|
- cvsC.addObject(temp);
|
|
|
+ cvsC.addObject(temp, false);
|
|
|
|
|
|
} else {
|
|
|
// else look up the table and put it into the right Uppernode
|
|
|
CpsUpperNode temp2 = (CpsUpperNode) objDispatch.get(Integer.parseInt(temp.getSav()));
|
|
|
- uppC.addObjectInUpperNode(temp, temp2, false);
|
|
|
- }
|
|
|
+ if(temp2 != null)
|
|
|
+ uppC.addObjectInUpperNode(temp, temp2, false);
|
|
|
+ else{
|
|
|
+ /**
|
|
|
+ * if null try to load on canvas
|
|
|
+ */
|
|
|
+ cvsC.addObject(temp, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
objDispatch.put(temp.getId(), temp);
|
|
|
|
|
@@ -319,6 +327,11 @@ public class LoadController {
|
|
|
model.getEdgesOnCanvas().add(temp);
|
|
|
break;
|
|
|
case CONNECTION:
|
|
|
+ if(temp.getA() == null || temp.getB() == null){
|
|
|
+ System.err.println(temp.toString());
|
|
|
+ new Error().getStackTrace();
|
|
|
+ break;
|
|
|
+ }
|
|
|
// if no duplicates in connection store them into the given A and B
|
|
|
if (!uppC.lookforDuplicates(temp.getA(), temp.getB(), temp.getA().getConnections()))
|
|
|
temp.getA().getConnections().add(temp);
|
|
@@ -340,7 +353,12 @@ public class LoadController {
|
|
|
}
|
|
|
|
|
|
if (object.get("connection").getAsBoolean() && !type.equals(EDGETYPE.CONNECTION)) {
|
|
|
- temp.getA().getConnections().add(temp);
|
|
|
+ if(temp.getA() == null || temp.getB() == null){
|
|
|
+ System.err.println("invaldid Connection loaded: " + temp.toString());
|
|
|
+ new Error().printStackTrace();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ temp.getA().getConnections().add(temp);
|
|
|
temp.getB().getConnections().add(temp);
|
|
|
}
|
|
|
|