From da39d3cac3de567f88664a7589dff2b37c69a87f Mon Sep 17 00:00:00 2001 From: Bradley Meck Date: Sat, 8 Sep 2012 20:09:03 -0500 Subject: [PATCH] [fix] null values should merge properly instead of throwing errors --- lib/nconf/provider.js | 2 +- test/fixtures/data.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nconf/provider.js b/lib/nconf/provider.js index e83c3c6..413df5f 100644 --- a/lib/nconf/provider.js +++ b/lib/nconf/provider.js @@ -539,7 +539,7 @@ Provider.prototype._execute = function (action, syncLength /* [arguments] */) { response = store[action].apply(store, args); // Merge objects if necessary - if (action === 'get' && typeof response === 'object' && !Array.isArray(response)) { + if (response && action === 'get' && typeof response === 'object' && !Array.isArray(response)) { mergeObjs.push(response); response = undefined; } diff --git a/test/fixtures/data.js b/test/fixtures/data.js index 604dc05..06925af 100644 --- a/test/fixtures/data.js +++ b/test/fixtures/data.js @@ -6,6 +6,7 @@ */ exports.data = { + isNull: null, literal: 'bazz', arr: ['one', 2, true, { value: 'foo' }], obj: {