From e3537e7bb7e098b3e96f1e693b4eef4d59028694 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Thu, 17 Mar 2022 15:50:52 +1100 Subject: [PATCH] fix(web): crash on focus before init Fixes the following crash noted when testing on keymanweb.com, focusing during the load process on a slow network. ``` helpers.ts:111 Uncaught TypeError: Cannot read properties of null (reading 'vkbd') at g.pageFocusHandler (keymanweb.ts:125:44) at sentryWrapped (helpers.ts:87:17) ``` --- web/source/keymanweb.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/source/keymanweb.ts b/web/source/keymanweb.ts index 79aa71ac58..61d523f6fa 100644 --- a/web/source/keymanweb.ts +++ b/web/source/keymanweb.ts @@ -122,7 +122,7 @@ if(!window['keyman']['initialized']) { **/ function resetVKShift() { let keyman = com.keyman.singleton; - if(!keyman.uiManager.isActivating && keyman.osk.vkbd) { + if(!keyman.uiManager.isActivating && keyman.osk?.vkbd) { keyman.core.keyboardProcessor._UpdateVKShift(null); //this should be enabled !!!!! TODO } }