From 4e437582365cd1b9f8261be9405180feef382357 Mon Sep 17 00:00:00 2001 From: omar92 Date: Mon, 3 Apr 2023 21:27:43 +0200 Subject: [PATCH] fix bug in reroute node , that didnt allow to load old worflows --- web/extensions/core/rerouteNode.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/extensions/core/rerouteNode.js b/web/extensions/core/rerouteNode.js index 1342cae9..aee5d147 100644 --- a/web/extensions/core/rerouteNode.js +++ b/web/extensions/core/rerouteNode.js @@ -50,12 +50,12 @@ app.registerExtension({ } else { // Move the previous node - currentNode = node; + currentNode = node; } } else { // We've found the end inputNode = currentNode; - inputType = node.outputs[link.origin_slot].type; + inputType = node.outputs[link.origin_slot]?.type ?? null; break; } } else { @@ -87,7 +87,7 @@ app.registerExtension({ updateNodes.push(node); } else { // We've found an output - const nodeOutType = node.inputs[link.target_slot].type; + const nodeOutType = node.inputs && node.inputs[link?.target_slot] && node.inputs[link.target_slot].type ? node.inputs[link.target_slot].type : null; if (inputType && nodeOutType !== inputType) { // The output doesnt match our input so disconnect it node.disconnectInput(link.target_slot);