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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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) {