Stricter return value check on LGraphCanvas.getExtraMenuOptions (#401)

This commit is contained in:
Chenlei Hu
2024-12-27 13:51:31 -05:00
committed by GitHub
parent c7ce89e10f
commit 54d7292d24

View File

@@ -8061,7 +8061,7 @@ export class LGraphCanvas {
}
const extra = this.getExtraMenuOptions?.(this, options)
return extra
return Array.isArray(extra)
? options.concat(extra)
: options
}
@@ -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)
}