decalre targetNode after check sourceNode
This commit is contained in:
parent
6a8de2edb2
commit
ffcd75a408
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue