diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index 6254773e656..6b175beb8b7 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -123,10 +123,10 @@ export class UiInputs { case Mode.PARTY: case Mode.SUMMARY: case Mode.STARTER_SELECT: - case Mode.CONFIRM: case Mode.OPTION_SELECT: this.scene.ui.setOverlayMode(Mode.MENU); break; + case Mode.CONFIRM: case Mode.MENU: case Mode.SETTINGS: case Mode.ACHIEVEMENTS: diff --git a/src/ui/abstact-option-select-ui-handler.ts b/src/ui/abstact-option-select-ui-handler.ts index 82e8ab0da35..19f5d8dc5d0 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -171,8 +171,8 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { return false; } } - const option = this.config.options[this.cursor + (this.scrollCursor - (this.scrollCursor ? 1 : 0))]; - if (option.handler()) { + const option = this.config?.options[this.cursor + (this.scrollCursor - (this.scrollCursor ? 1 : 0))]; + if (option?.handler()) { if (!option.keepOpen) { this.clear(); }