Skip to content

Commit

Permalink
Stricter return value check on LGraphCanvas.getExtraMenuOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Dec 27, 2024
1 parent c7ce89e commit 52e5aa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8061,7 +8061,7 @@ export class LGraphCanvas {
}

const extra = this.getExtraMenuOptions?.(this, options)
return extra
return Array.isArray(extra)
? options.concat(extra)
: options
}
Expand Down Expand Up @@ -8159,7 +8159,7 @@ export class LGraphCanvas {
if (outputs?.length) options[1].disabled = false

const extra = node.getExtraMenuOptions?.(this, options)
if (extra) {
if (Array.isArray(extra) && extra.length > 0) {
extra.push(null)
options = extra.concat(options)
}
Expand Down

0 comments on commit 52e5aa5

Please sign in to comment.