mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: clear children before building tree
prevents infinite loop on databases that have children array saved in database
This commit is contained in:
@@ -395,6 +395,7 @@ Categories.getTree = function (categories, parentCid) {
|
||||
const parents = {};
|
||||
cids.forEach((cid, index) => {
|
||||
if (cid) {
|
||||
categories[index].children = undefined;
|
||||
cidToCategory[cid] = categories[index];
|
||||
parents[cid] = _.clone(categories[index]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user