Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): Prevent TypeError from undefined event.key in global search shortcut (#13472)

seer-by-sentry[bot]38d834b18a97
diff --git a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx
index 524d739e32..5605d1c510 100644
--- a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx
@@ -36,7 +36,7 @@ export function GlobalSearchOverlay() {
if (!isEnabled) return;
function handleSearchShortcut(event: KeyboardEvent) {
if (event.repeat) return;
- if (event.key.toLocaleLowerCase() !== "k") return;
+ if (!event.key || event.key.toLocaleLowerCase() !== "k") return;
if (!event.metaKey && !event.ctrlKey) return;
// The new layout binds Cmd/Ctrl+Shift+K; the classic chat-search path
// keeps its original plain Cmd/Ctrl+K, so only require Shift on the new