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.
This commit is contained in:
parent
0ca7cf4867
commit
7caa9c20c2
|
@ -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]]);
|
||||
|
|
Loading…
Reference in New Issue