diff --git a/src/LogicalGraph.ts b/src/LogicalGraph.ts index 37f1815d0..c25d75455 100644 --- a/src/LogicalGraph.ts +++ b/src/LogicalGraph.ts @@ -84,6 +84,16 @@ export class LogicalGraph { const srcNode = graph.findNodeByKey(srcKey); const destNode = graph.findNodeByKey(destKey); + // if source and destination node could not be found, skip edge + if (srcNode === null){ + console.warn("Could not find edge (", srcKey, "->", destKey, ") source node by key (", srcKey, "), skipping"); + continue; + } + if (destNode === null){ + console.warn("Could not find edge (", srcKey, "->", destKey, ") destination node by key (", destKey, "), skipping"); + continue; + } + // for OJS format, we actually store links using the node keys of the construct, not the node keys of the embedded applications if (srcNode.isEmbedded()){ srcKey = srcNode.getEmbedKey(); diff --git a/src/Node.ts b/src/Node.ts index 16790e586..ec0029cae 100644 --- a/src/Node.ts +++ b/src/Node.ts @@ -1175,6 +1175,13 @@ export class Node { result.paletteDownloadUrl(this.paletteDownloadUrl()); result.dataHash(this.dataHash()); + if (this.hasInputApplication()){ + result.inputApplication(this.inputApplication().clone()); + } + if (this.hasOutputApplication()){ + result.outputApplication(this.outputApplication().clone()); + } + return result; }