diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index 63a841beb..1f60acee0 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -649,42 +649,39 @@ RED.nodes = (function() { } function checkForMatchingSubflow(subflow,subflowNodes) { + subflowNodes = subflowNodes || []; var i; var match = null; - try { - RED.nodes.eachSubflow(function(sf) { - if (sf.name != subflow.name || - sf.info != subflow.info || - sf.in.length != subflow.in.length || - sf.out.length != subflow.out.length) { - return; - } - var sfNodes = RED.nodes.filterNodes({z:sf.id}); - if (sfNodes.length != subflowNodes.length) { + RED.nodes.eachSubflow(function(sf) { + if (sf.name != subflow.name || + sf.info != subflow.info || + sf.in.length != subflow.in.length || + sf.out.length != subflow.out.length) { return; - } + } + var sfNodes = RED.nodes.filterNodes({z:sf.id}); + if (sfNodes.length != subflowNodes.length) { + return; + } - var subflowNodeSet = [subflow].concat(subflowNodes); - var sfNodeSet = [sf].concat(sfNodes); + var subflowNodeSet = [subflow].concat(subflowNodes); + var sfNodeSet = [sf].concat(sfNodes); - var exportableSubflowNodes = JSON.stringify(subflowNodeSet); - var exportableSFNodes = JSON.stringify(createExportableNodeSet(sfNodeSet)); - var nodeMap = {}; - for (i=0;i