fix(web): crash in highlightKey when key.className is not a string

Fixes KEYMAN-WEB-X
This commit is contained in:
Marc Durdin 2022-06-01 12:23:02 +10:00 • committed by GitHub
parent fa3e37cdba
commit 9fef046b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1921,7 +1921,7 @@ namespace com.keyman.osk {
**/
highlightKey(key: KeyElement, on: boolean) {
// Do not change element class unless a key
if(!key || (key.className == '') || (key.className.indexOf('kmw-key-row') >= 0)) return;
if(!key || (key.className == '') || (typeof key.className != 'string') || (key.className.indexOf('kmw-key-row') >= 0)) return;
var classes=key.className, cs = ' kmw-key-touched';