Skip to content

Commit

Permalink
Merge pull request #191 from SynBioDex/fix-interaction-saving-with-on…
Browse files Browse the repository at this point in the history
…ly-one-participant

Fix null pointer from encoding interactions
  • Loading branch information
cjmyers authored Sep 10, 2021
2 parents 71c4ae6 + 1476baa commit 1200bc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SBOLCanvasBackend/src/utils/LayoutHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public mxCell[] getGraphicalObjects(URI layoutRef, String displayId) {
break;
}
}
cell.getGeometry().setSourcePoint(targetPoint);
cell.getGeometry().setTargetPoint(targetPoint);
break;
case "point":
mxPoint point = new mxPoint();
Expand Down
6 changes: 4 additions & 2 deletions SBOLCanvasBackend/src/utils/MxToSBOL.java
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,10 @@ private void linkModuleDefinition(SBOLDocument document, mxGraph graph, mxGraphM
ArrayList<mxCell> uniqueInteractionCells = new ArrayList<mxCell>();
for (mxCell edge : Arrays.stream(mxGraphModel.getChildCells(model, viewCell, false, true))
.toArray(mxCell[]::new)) {
if (((mxCell) edge.getSource()).getStyle().contains(STYLE_INTERACTION_NODE)
|| ((mxCell) edge.getTarget()).getStyle().contains(STYLE_INTERACTION_NODE)) {
mxCell source = ((mxCell) edge.getSource());
mxCell target = ((mxCell) edge.getTarget());
if ((source != null && source.getStyle().contains(STYLE_INTERACTION_NODE))
|| (target != null && target.getStyle().contains(STYLE_INTERACTION_NODE))) {
continue;
}
uniqueInteractionCells.add(edge);
Expand Down

0 comments on commit 1200bc9

Please sign in to comment.