From 52e5aa5caa36758a45f8d9b5a0f23deb4245263d Mon Sep 17 00:00:00 2001 From: huchenlei Date: Fri, 27 Dec 2024 12:31:57 -0500 Subject: [PATCH] Stricter return value check on LGraphCanvas.getExtraMenuOptions --- src/LGraphCanvas.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index 3373b8f..e9644c7 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -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) }