diff options
author | Martin André <martin.andre@kvhasia.com> | 2014-09-17 16:31:12 +0900 |
---|---|---|
committer | Martin André <martin.andre@kvhasia.com> | 2014-09-17 16:50:05 +0900 |
commit | 7caa9c20c250eae31eb9761dfe845911429154d9 (patch) | |
tree | 7008fc4a180188846ca970293f915e2f6cb5db5f | |
parent | 0ca7cf4867f1dae585d254f16ad62c552648265f (diff) | |
download | novnc-7caa9c20c250eae31eb9761dfe845911429154d9.tar.gz |
Prevent noVNC loading error when invalid property is set on object
Util.set_defaults should accommodate with missing properties to prevent
'Uncaught TypeError: Cannot read property 'call' of undefined' error.
-rw-r--r-- | include/util.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/util.js b/include/util.js index c145d5a..a6045da 100644 --- a/include/util.js +++ b/include/util.js @@ -341,6 +341,10 @@ Util.set_defaults = function (obj, conf, defaults) { for (i = 0; i < keys.length; i++) { var setter = obj['_raw_set_' + keys[i]]; + if (!setter) { + Util.Warn('Invalid property ' + keys[i]); + continue; + } if (conf[keys[i]]) { setter.call(obj, conf[keys[i]]); |