explicit check for options

This commit is contained in:
Frederico Santos 2024-08-02 19:28:05 +01:00
parent 0d406b1092
commit 2f83e6e2e1
1 changed files with 1 additions and 1 deletions

View File

@ -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) {