From 7caa9c20c250eae31eb9761dfe845911429154d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Wed, 17 Sep 2014 16:31:12 +0900 Subject: [PATCH] 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. --- include/util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/util.js b/include/util.js index c145d5a6..a6045dac 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]]);