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