From ffcd75a408013c514e383cc4770fde07f25ee599 Mon Sep 17 00:00:00 2001 From: zl7261 Date: Mon, 29 Sep 2025 15:24:35 +0800 Subject: [PATCH] decalre targetNode after check sourceNode --- lightrag_webui/src/hooks/useLightragGraph.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightrag_webui/src/hooks/useLightragGraph.tsx b/lightrag_webui/src/hooks/useLightragGraph.tsx index ca47c7b7..124e837d 100644 --- a/lightrag_webui/src/hooks/useLightragGraph.tsx +++ b/lightrag_webui/src/hooks/useLightragGraph.tsx @@ -339,11 +339,12 @@ const fetchGraph = async (label: string, maxDepth: number, maxNodes: number) => const target = nodeIdMap[edge.target] if (source !== undefined && target !== undefined) { const sourceNode = rawData.nodes[source] - const targetNode = rawData.nodes[target] if (!sourceNode) { console.error(`Source node ${edge.source} is undefined`) continue } + + const targetNode = rawData.nodes[target] if (!targetNode) { console.error(`Target node ${edge.target} is undefined`) continue