From e8133c1be71ca6fd0a03cbdcd5658dcff26b2c52 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Sat, 19 Aug 2023 15:52:35 +0100 Subject: [PATCH] Fix crash with bad litegraph links referencing deleted nodes --- js/graphArrange.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/graphArrange.js b/js/graphArrange.js index 063d954..8f25e24 100644 --- a/js/graphArrange.js +++ b/js/graphArrange.js @@ -1,7 +1,5 @@ import { app } from "../../../scripts/app.js"; -// Adds right click -> arrange to the canvas - app.registerExtension({ name: "pysssss.GraphArrange", setup(app) { @@ -27,6 +25,7 @@ app.registerExtension({ if (out.links) { for (const link of out.links) { const outNode = app.graph.getNodeById(app.graph.links[link].target_id); + if (!outNode) continue; var l = outNode._level - 1; if (max === null) max = l; else if (l < max) max = l;