From 7be7dec19afd1c66f13eebe640a7e6adfc2abad0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sat, 27 Feb 2021 21:57:27 +0000 Subject: [PATCH] Fix removing links when deleting node --- .../node_modules/@node-red/editor-client/src/js/nodes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 cc55565f2..1729be177 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 @@ -31,7 +31,7 @@ RED.nodes = (function() { var groups = {}; var groupsByZ = {}; - +RED.nl = nodeLinks; var initialLoad; var dirty = false; @@ -429,13 +429,13 @@ RED.nodes = (function() { var index = links.indexOf(l); if (index != -1) { links.splice(index,1); - if (l.source) { + if (l.source && nodeLinks[l.source.id]) { var sIndex = nodeLinks[l.source.id].out.indexOf(l) if (sIndex !== -1) { nodeLinks[l.source.id].out.splice(sIndex,1) } } - if (l.target) { + if (l.target && nodeLinks[l.target.id]) { var tIndex = nodeLinks[l.target.id].in.indexOf(l) if (tIndex !== -1) { nodeLinks[l.target.id].in.splice(tIndex,1)