From ce048c05211ca3dff49599de9f5cb6c47c48b05b Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Thu, 1 Aug 2024 20:10:04 -0700 Subject: [PATCH] Anticrash. --- src/common/components/shortcuts/globalShortcutsHandler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/components/shortcuts/globalShortcutsHandler.ts b/src/common/components/shortcuts/globalShortcutsHandler.ts index 13b5db807..0216d9caa 100644 --- a/src/common/components/shortcuts/globalShortcutsHandler.ts +++ b/src/common/components/shortcuts/globalShortcutsHandler.ts @@ -13,6 +13,10 @@ export function ensureGlobalShortcutHandler() { function _handleGlobalShortcutKeyDown(event: KeyboardEvent) { + // Quicker-out: if the key is null, stop here + if (!event.key) + return; + // Quick-out: either the key is escape/left/right, or we have a modifier key pressed -- otherwise we exit const lcEventKey = event.key.toLowerCase(); if (lcEventKey !== 'escape' && lcEventKey !== 'arrowleft' && lcEventKey !== 'arrowright' &&