FIX: Ensure that categories array is not undefined (#25141)

With lazy_load_categories enabled, the categories array can be undefined
because it is not loaded yet (it is populated on demand).
This commit is contained in:
Bianca Nenciu
2024-01-05 20:45:21 +02:00
committed by GitHub
parent 0fe11ef337
commit 62e570afe2

View File

@@ -377,7 +377,7 @@ Category.reopenClass({
const reduce = (values) =>
values.flatMap((c) => [c, reduce(children.get(c.id) || [])]).flat();
return reduce(children.get(-1));
return reduce(children.get(-1) || []);
},
isUncategorized(categoryId) {