From 902b32a0b4c87ea7028c632d663b34a5297884f8 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Wed, 13 Mar 2024 14:58:28 +0100 Subject: [PATCH] fix: fix handling of undefined key in event handler (fehmer) (#5223) --- frontend/src/ts/event-handlers/global.ts | 1 + frontend/src/ts/ready.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/src/ts/event-handlers/global.ts b/frontend/src/ts/event-handlers/global.ts index 5ade85713..d6d440541 100644 --- a/frontend/src/ts/event-handlers/global.ts +++ b/frontend/src/ts/event-handlers/global.ts @@ -6,6 +6,7 @@ import { getCommandline } from "../utils/async-modules"; document.addEventListener("keydown", async (e) => { if (PageTransition.get()) return; + if (e.key === undefined) return; if ( (e.key === "Escape" && Config.quickRestart !== "esc") || diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts index a34af177f..0392d91fe 100644 --- a/frontend/src/ts/ready.ts +++ b/frontend/src/ts/ready.ts @@ -131,6 +131,7 @@ window.onunhandledrejection = function (e): void { customTitle: "DEV: Unhandled rejection", duration: 5, }); + console.error(e); } void log("error", { error: e.reason.stack ?? "",