diff --git a/lib/stringify.js b/lib/stringify.js index 3bdd4e93..2666eaf9 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -162,7 +162,7 @@ var stringify = function stringify( for (var j = 0; j < objKeys.length; ++j) { var key = objKeys[j]; - var value = typeof key === 'object' && typeof key.value !== 'undefined' + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' ? key.value : obj[key]; diff --git a/test/stringify.js b/test/stringify.js index be9186d6..75eaf738 100644 --- a/test/stringify.js +++ b/test/stringify.js @@ -1298,7 +1298,7 @@ test('stringifies empty keys', function (t) { t.test('stringifies non-string keys', function (st) { var actual = qs.stringify({ a: 'b', 'false': {} }, { - filter: ['a', false], + filter: ['a', false, null], allowDots: true, encodeDotInKeys: true });