summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolly Ross <sross@redhat.com>2014-09-19 14:48:00 -0400
committerSolly Ross <sross@redhat.com>2014-09-19 14:48:00 -0400
commitcfc02e5e2bccfe2c1a80e4097372b8423ce9d87a (patch)
tree39fb8c922efd17162404aa94f0edd332ecacbc2e
parentd02a99f0c85557115caa99ff729bc1e2209a0a4a (diff)
downloadnovnc-cfc02e5e2bccfe2c1a80e4097372b8423ce9d87a.tar.gz
Fixed presence detection bug in utils.set_defaults
Previously, Utils.set_defaults was using `if(conf[keys[i]])` to check for the presence of a configuration key. This would fail if `conf[keys[i]]` happened to be false. Instead, we now use `if(keys[i] in conf)`, which simply checks for the presence of the key in the conf object.
-rw-r--r--include/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/util.js b/include/util.js
index a6045da..9e5f98c 100644
--- a/include/util.js
+++ b/include/util.js
@@ -346,7 +346,7 @@ Util.set_defaults = function (obj, conf, defaults) {
continue;
}
- if (conf[keys[i]]) {
+ if (keys[i] in conf) {
setter.call(obj, conf[keys[i]]);
} else {
setter.call(obj, defaults[keys[i]]);