diff options
author | samhed <samuel@cendio.se> | 2015-03-05 09:54:56 +0100 |
---|---|---|
committer | samhed <samuel@cendio.se> | 2015-03-05 09:54:56 +0100 |
commit | 3b8ec46fd26d644e6edbea4f46e630929297e448 (patch) | |
tree | 043f505f61d223275528392af9bbff74584046bc | |
parent | 205d1a11ce71744f1e95c6849f9652b65487a652 (diff) | |
download | novnc-3b8ec46fd26d644e6edbea4f46e630929297e448.tar.gz |
Make the touch-keyboard code more robust through verifying that global variables are set before use.
-rw-r--r-- | include/ui.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/ui.js b/include/ui.js index a5433dc..fb28e3e 100644 --- a/include/ui.js +++ b/include/ui.js @@ -925,8 +925,15 @@ var UI; // This code is required since some browsers on Android are inconsistent in // sending keyCodes in the normal keyboard events when using on screen keyboards. keyInput: function(event) { + + if (!UI.rfb) { return; } + var newValue = event.target.value; - var oldValue = UI.lastKeyboardinput; + + if (!UI.lastKeyboardinput) { + UI.keyboardinputReset(); + } + var oldvalue = UI.lastKeyboardinput; var newLen; try { |