Closed mcdurdin closed 9 months ago
Found the cause.
The important part:
function(p){if(!pageLoading) changeKeyboard(p['internalName'],p['languageCode'],p);}
Note the implicit assumption: that p
is not null
.
The other contributor:
Note that there is no check against replacing the initially-empty (null
) active keyboard with... another null
. As a result, when loading keymanweb.com on a desktop form-factor device, which doesn't specify a default keyboard, the event is raised with a null
object.
The error does not happen on mobile because we force a default selection on mobile. Keyboard stubs are ready by this point; mobile picks one, while desktop does not. That's the difference.
So, there are two ways this can be fixed:
null
-> null
keyboard-change events.
null
-> null
- unlike with non-null change-to-same requests, which could be indicative of resource updates when embedded in mobile app webviews.Either should suffice.
Either should suffice.
Good analysis. Let's do both of these -- defence in depth.
Hold a second... it's not so much the null guard here as much as in the method it calls. Same idea, though.
Looks like the actual problem arises when trying to get the keyboard object when there is no stub. The error does arise within KMW code. But yeah, fix in both spots - can do.
URL: https://keymanweb.com/?version=17.0.228#hy,Keyboard_armenian