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 54c89157a..c9f78cb25 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 @@ -2406,8 +2406,9 @@ RED.nodes = (function() { // get added if (activeSubflow && /^link /.test(n.type) && n.links) { n.links = n.links.filter(function(id) { - const otherNode = node_map[id] || RED.nodes.node(id); - return (otherNode && otherNode.z === activeWorkspace) + const otherNodeInMap = Object.values(node_map).filter(function(n) { return n.id === id; }); + const otherNode = (otherNodeInMap.length ? otherNodeInMap[0] : null) || RED.nodes.node(id); + return (otherNode && otherNode.z === activeWorkspace); }); } }