mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
prevent crash in getChildren
This commit is contained in:
@@ -288,7 +288,7 @@ var async = require('async'),
|
||||
// Filter categories to isolate children, and remove disabled categories
|
||||
async.map(cids, function(cid, next) {
|
||||
next(null, categories.filter(function(category) {
|
||||
return parseInt(category.parentCid, 10) === parseInt(cid, 10) && !category.disabled;
|
||||
return category && parseInt(category.parentCid, 10) === parseInt(cid, 10) && !category.disabled;
|
||||
}));
|
||||
}, next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user