mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -377,7 +377,7 @@ Category.reopenClass({
|
|||||||
const reduce = (values) =>
|
const reduce = (values) =>
|
||||||
values.flatMap((c) => [c, reduce(children.get(c.id) || [])]).flat();
|
values.flatMap((c) => [c, reduce(children.get(c.id) || [])]).flat();
|
||||||
|
|
||||||
return reduce(children.get(-1));
|
return reduce(children.get(-1) || []);
|
||||||
},
|
},
|
||||||
|
|
||||||
isUncategorized(categoryId) {
|
isUncategorized(categoryId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user