From 200021b27a095f4f0c21c28dc1d7d96d7abecf5b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 13 Oct 2014 14:22:59 -0700 Subject: [PATCH] GUAC-875: Handle possibly-null key identifier. --- guacamole-common-js/src/main/webapp/modules/Keyboard.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index 163aef0cc..37145307e 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -640,10 +640,15 @@ Guacamole.Keyboard = function(element) { * @param {String} keyIdentifier The legacy keyIdentifier from a * browser keydown/keyup event. * @returns {Boolean} true if the keyIdentifier looks sane, false if - * the keyIdentifier appears incorrectly derived. + * the keyIdentifier appears incorrectly derived or + * is missing entirely. */ function key_identifier_sane(keyCode, keyIdentifier) { + // Missing identifier is not sane + if (!keyIdentifier) + return false; + // Assume non-Unicode keyIdentifier values are sane var unicodePrefixLocation = keyIdentifier.indexOf("U+"); if (unicodePrefixLocation === -1)