fix redis warnings

This commit is contained in:
Baris Usakli
2018-07-06 14:20:37 -04:00
parent cc6a683bc4
commit 16a7728ab8
2 changed files with 5 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ module.exports = function (redisClient, module) {
}
Object.keys(data).forEach(function (key) {
if (data[key] === undefined) {
if (data[key] === undefined || data[key] === null) {
delete data[key];
}
});
@@ -26,6 +26,9 @@ module.exports = function (redisClient, module) {
module.setObjectField = function (key, field, value, callback) {
callback = callback || function () {};
if (!field) {
return callback();
}
redisClient.hset(key, field, value, function (err) {
callback(err);
});