Commit 7caa9c20 authored by Martin André's avatar Martin André

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.
parent 0ca7cf48
...@@ -341,6 +341,10 @@ Util.set_defaults = function (obj, conf, defaults) { ...@@ -341,6 +341,10 @@ Util.set_defaults = function (obj, conf, defaults) {
for (i = 0; i < keys.length; i++) { for (i = 0; i < keys.length; i++) {
var setter = obj['_raw_set_' + keys[i]]; var setter = obj['_raw_set_' + keys[i]];
if (!setter) {
Util.Warn('Invalid property ' + keys[i]);
continue;
}
if (conf[keys[i]]) { if (conf[keys[i]]) {
setter.call(obj, conf[keys[i]]); setter.call(obj, conf[keys[i]]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment