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]
|
const target = nodeIdMap[edge.target]
|
||||||
if (source !== undefined && target !== undefined) {
|
if (source !== undefined && target !== undefined) {
|
||||||
const sourceNode = rawData.nodes[source]
|
const sourceNode = rawData.nodes[source]
|
||||||
const targetNode = rawData.nodes[target]
|
|
||||||
if (!sourceNode) {
|
if (!sourceNode) {
|
||||||
console.error(`Source node ${edge.source} is undefined`)
|
console.error(`Source node ${edge.source} is undefined`)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const targetNode = rawData.nodes[target]
|
||||||
if (!targetNode) {
|
if (!targetNode) {
|
||||||
console.error(`Target node ${edge.target} is undefined`)
|
console.error(`Target node ${edge.target} is undefined`)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue