From 42c088a0d96346227fafd1c8b37ea723676f37cd Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Tue, 10 Mar 2026 10:09:28 +0300 Subject: [PATCH] Add navigator.keyboard null check Browser can have a null keyboard property, so we need to check for nullability. --- web/js/input/keyboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/js/input/keyboard.js b/web/js/input/keyboard.js index 4c26e9db..3ec4007d 100644 --- a/web/js/input/keyboard.js +++ b/web/js/input/keyboard.js @@ -53,7 +53,8 @@ let keyMap = {}; // special mode for changing button bindings in the options let isKeysFilteredMode = true; // if the browser supports Keyboard Lock API (Firefox does not) -let hasKeyboardLock = ('keyboard' in navigator) && ('lock' in navigator.keyboard) +let hasKeyboardLock = ('keyboard' in navigator) + && navigator.keyboard && ('lock' in navigator.keyboard) let locked = false