decalre targetNode after check sourceNode

This commit is contained in:
zl7261 2025-09-29 15:24:35 +08:00 committed by GitHub
parent 6a8de2edb2
commit ffcd75a408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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