mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
dont return undefined from sortedSetsCard if keys is empty or falsy
This commit is contained in:
@@ -149,7 +149,7 @@ module.exports = function (db, module) {
|
||||
|
||||
module.sortedSetsCard = function (keys, callback) {
|
||||
if (!Array.isArray(keys) || !keys.length) {
|
||||
return callback();
|
||||
return callback(null, []);
|
||||
}
|
||||
var pipeline = [
|
||||
{ $match: { _key: { $in: keys } } },
|
||||
|
||||
@@ -231,7 +231,7 @@ SELECT COUNT(*) c
|
||||
|
||||
module.sortedSetsCard = function (keys, callback) {
|
||||
if (!Array.isArray(keys) || !keys.length) {
|
||||
return callback();
|
||||
return callback(null, []);
|
||||
}
|
||||
|
||||
query({
|
||||
|
||||
@@ -116,7 +116,7 @@ module.exports = function (redisClient, module) {
|
||||
};
|
||||
|
||||
module.sortedSetsCard = function (keys, callback) {
|
||||
if (Array.isArray(keys) && !keys.length) {
|
||||
if (!Array.isArray(keys) || !keys.length) {
|
||||
return callback(null, []);
|
||||
}
|
||||
var batch = redisClient.batch();
|
||||
|
||||
Reference in New Issue
Block a user