From 44cbc717c2699eb5c821f9a82d5f6966a6a05c6e Mon Sep 17 00:00:00 2001 From: Joe Hart Date: Tue, 3 Jun 2025 10:27:18 -0400 Subject: [PATCH] Add undefined check to oncontextmenu handler --- src/lib/components/Keyboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/Keyboard.ts b/src/lib/components/Keyboard.ts index 072e46ca..efecb096 100644 --- a/src/lib/components/Keyboard.ts +++ b/src/lib/components/Keyboard.ts @@ -1495,7 +1495,7 @@ class SimpleKeyboard { /* istanbul ignore next */ disableContextualWindow() { window.oncontextmenu = (event: KeyboardHandlerEvent) => { - if (event.target.classList.contains("hg-button")) { + if (event.target.classList?.contains("hg-button")) { event.preventDefault(); event.stopPropagation(); return false;