From 1f6e15190aec37ecbbaa96f4b6a4fb5c64f9eef7 Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Thu, 23 Apr 2026 12:38:57 +0800 Subject: [PATCH] fix: guard getActiveNodes against undefined graph.nodes --- graph/graph.js | 1 + 1 file changed, 1 insertion(+) diff --git a/graph/graph.js b/graph/graph.js index e8e62e5..5429670 100644 --- a/graph/graph.js +++ b/graph/graph.js @@ -287,6 +287,7 @@ export function removeNode(graph, nodeId, visited = new Set()) { * @returns {object[]} */ export function getActiveNodes(graph, typeFilter = null) { + if (!Array.isArray(graph?.nodes)) return []; let nodes = graph.nodes.filter((n) => !n.archived); if (typeFilter) { nodes = nodes.filter((n) => n.type === typeFilter);