fix: prevent infinite loops if category is already in children

This commit is contained in:
Barış Soner Uşaklı
2019-03-13 12:43:47 -04:00
parent b2fbeb053a
commit b71e0eb179

View File

@@ -345,7 +345,7 @@ Categories.getChildrenCids = function (rootCid, callback) {
if (err) {
return callback(err);
}
childrenCids = childrenCids.filter(cid => !allCids.includes(parseInt(cid, 10)));
if (!childrenCids.length) {
return callback();
}