From 2f83e6e2e1f21bd1e8669330432899fb11a247d6 Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Fri, 2 Aug 2024 19:28:05 +0100 Subject: [PATCH] explicit check for options --- src/ui/menu-ui-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 755267fcede..6d70bb27ae5 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -332,7 +332,7 @@ export default class MenuUiHandler extends MessageUiHandler { if (button === Button.ACTION) { let adjustedCursor = this.cursor; const excludedMenu = this.excludedMenus().find(e => e.condition); - if (excludedMenu !== null && excludedMenu.options.length > 0) { + if (excludedMenu !== null && excludedMenu.options !== undefined && excludedMenu.options.length > 0) { const sortedOptions = excludedMenu.options.sort(); for (const imo of sortedOptions) { if (adjustedCursor >= imo) {