mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
fix redis warnings
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user