From 52e74a2bb2393aebd32e98557e3b547560d878a9 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Fri, 17 Mar 2023 17:52:20 +0000 Subject: [PATCH] Fixed crash removing nodes due to output link is still being set but not valid --- web/extensions/core/rerouteNode.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/extensions/core/rerouteNode.js b/web/extensions/core/rerouteNode.js index 0dc9ad3..7188dfd 100644 --- a/web/extensions/core/rerouteNode.js +++ b/web/extensions/core/rerouteNode.js @@ -107,12 +107,18 @@ app.registerExtension({ node.size = node.computeSize(); for (const l of node.outputs[0].links || []) { - app.graph.links[l].color = color; + const link = app.graph.links[l]; + if (link) { + link.color = color; + } } } if (inputNode) { - app.graph.links[inputNode.inputs[0].link].color = color; + const link = app.graph.links[inputNode.inputs[0].link]; + if (link) { + link.color = color; + } } };