diff --git a/socks.js b/socks.js index 2c33fdd..0306ea4 100755 --- a/socks.js +++ b/socks.js @@ -313,10 +313,12 @@ var proxyData = function () { }; var defaults = function(obj) { + if (!obj) + obj = {}; Array.prototype.slice.call(arguments, 1).forEach(function(source) { if (source) { for (var prop in source) { - if (obj[prop] === null) { + if (typeof obj[prop] === 'undefined') { obj[prop] = source[prop]; } }