From 0a5bccde47a90f9ee1b4a0b7b27753dc1c9cbdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Thu, 28 Nov 2013 17:50:26 +0100 Subject: [PATCH] Allow passing an empty array as a configuration parameter. --- src/UA.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UA.js b/src/UA.js index 24ef59213..0093da947 100644 --- a/src/UA.js +++ b/src/UA.js @@ -806,8 +806,8 @@ UA.prototype.loadConfig = function(configuration) { if(configuration.hasOwnProperty(parameter)) { value = configuration[parameter]; - // If the parameter value is null, empty string or undefined then apply its default value. - if(value === null || value === "" || value === undefined) { continue; } + // If the parameter value is null, empty string, undefined or empty array then apply its default value. + if(value === null || value === "" || value === undefined || (value instanceof Array && value.length === 0)) { continue; } // If it's a number with NaN value then also apply its default value. // NOTE: JS does not allow "value === NaN", the following does the work: else if(typeof(value) === 'number' && window.isNaN(value)) { continue; }