mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
bulk fix
This commit is contained in:
@@ -76,7 +76,7 @@ Controllers.home = function(req, res, next) {
|
||||
childCategories.push.apply(childCategories, categoryData[i].children);
|
||||
}
|
||||
|
||||
if (categoryData[i].parent) {
|
||||
if (categoryData[i].parent && categoryData[i].parent.cid) {
|
||||
categoryData.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,11 @@ module.exports = function(db, module) {
|
||||
|
||||
module.setsAdd = function(keys, value, callback) {
|
||||
callback = callback || helpers.noop;
|
||||
|
||||
if (!Array.isArray(keys) || !keys.length) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
if(!Array.isArray(value)) {
|
||||
value = [value];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user