Add undefined check to oncontextmenu handler

This commit is contained in:
Joe Hart
2025-06-03 10:27:18 -04:00
parent 604c731c6e
commit 44cbc717c2
+1 -1
View File
@@ -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;