nconf-redis
nconf-redis copied to clipboard
null value throws TypeError
If you have an JSON key that contains some null values it will throw an exception when you try to save the key.
TL;DR
demo of the issue: https://gist.github.com/itayw/7566317
JSON example:
var badJSON = {
port: 40008,
securePort: null
}
Fails on:
-->nconf.set('badJSON', badJSON, function(err) {
if (err)
throw err;
nconf.get('badJSON', function(err, value) {
if (err)
throw err;
if (value)
console.log('bad JSON value set and get fine.');
else
console.log('Failed to set and get bad JSON value')
});
});
Exception and stack:
TypeError: Object.keys called on non-object
at Function.keys (native)
at Redis._setObject (/.../dev/joola.io.manage/node_modules/nconf-redis/lib/nconf-redis.js:425:23)
...
I'm getting this issue as well :|