Skip to content

Commit

Permalink
fix defaults not setting non-nulls (related to M2Ys4U#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Dec 9, 2014
1 parent 4e5e906 commit 86c088e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion socks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 86c088e

Please sign in to comment.