GUAC-875: Handle possibly-null key identifier.

This commit is contained in:
Michael Jumper
2014-10-13 14:22:59 -07:00
parent c1e5822a19
commit 200021b27a

View File

@@ -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)