Skip to content

A platform for community discussion. Free, open, simple.

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

Bianca Nenciu62e570afe2b4
diff --git a/app/assets/javascripts/discourse/app/models/category.js b/app/assets/javascripts/discourse/app/models/category.js
index 6bd2bea61fb..7b80c98035c 100644
--- a/app/assets/javascripts/discourse/app/models/category.js
+++ b/app/assets/javascripts/discourse/app/models/category.js
@@ -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) {