fix bug in reroute node , that didnt allow to load old worflows

This commit is contained in:
omar92 2023-04-03 21:27:43 +02:00
parent f50b1fec69
commit 4e43758236

View File

@ -55,7 +55,7 @@ app.registerExtension({
} else { } else {
// We've found the end // We've found the end
inputNode = currentNode; inputNode = currentNode;
inputType = node.outputs[link.origin_slot].type; inputType = node.outputs[link.origin_slot]?.type ?? null;
break; break;
} }
} else { } else {
@ -87,7 +87,7 @@ app.registerExtension({
updateNodes.push(node); updateNodes.push(node);
} else { } else {
// We've found an output // 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) { if (inputType && nodeOutType !== inputType) {
// The output doesnt match our input so disconnect it // The output doesnt match our input so disconnect it
node.disconnectInput(link.target_slot); node.disconnectInput(link.target_slot);