Skip to content

Commit ac9234c

Browse files
committed
refactor: catch error inside renderCustomLink
findEle will break the logic running after it
1 parent 5560e88 commit ac9234c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/customLink.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ export function renderCustomLink(this: MindElixirInstance) {
284284
this.linkSvgGroup.innerHTML = ''
285285
for (const prop in this.linkData) {
286286
const link = this.linkData[prop]
287-
this.drawCustomLink(findEle(link.from), findEle(link.to), link, true)
287+
try {
288+
this.drawCustomLink(findEle(link.from), findEle(link.to), link, true)
289+
} catch (e) {
290+
console.warn('Node may not be expanded')
291+
}
288292
}
289293
this.nodes.appendChild(this.linkSvgGroup)
290294
}

0 commit comments

Comments
 (0)