diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index a179f529a..bf012fd13 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -3753,11 +3753,13 @@ export class LGraphCanvas implements ConnectionColorContext { // Highlight links if (item.inputs) { for (const input of item.inputs) { + if (input.link == null) continue this.highlighted_links[input.link] = true } } if (item.outputs) { for (const id of item.outputs.flatMap(x => x.links)) { + if (id == null) continue this.highlighted_links[id] = true } } @@ -3783,11 +3785,13 @@ export class LGraphCanvas implements ConnectionColorContext { // Clear link highlight if (item.inputs) { for (const input of item.inputs) { + if (input.link == null) continue delete this.highlighted_links[input.link] } } if (item.outputs) { for (const id of item.outputs.flatMap(x => x.links)) { + if (id == null) continue delete this.highlighted_links[id] } } @@ -3882,11 +3886,13 @@ export class LGraphCanvas implements ConnectionColorContext { // Highlight links if (keepSelected.inputs) { for (const input of keepSelected.inputs) { + if (input.link == null) continue this.highlighted_links[input.link] = true } } if (keepSelected.outputs) { for (const id of keepSelected.outputs.flatMap(x => x.links)) { + if (id == null) continue this.highlighted_links[id] = true } }