mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
DEV: Fix lazy_load_categories for uncategorized topic lists (#24028)
This commit is contained in:
parent
75441e063a
commit
e7afd18155
|
@ -77,7 +77,8 @@ class TopicList
|
||||||
end
|
end
|
||||||
|
|
||||||
def categories
|
def categories
|
||||||
@categories ||= topics.map { |t| [t.category, t.category.parent_category] }.uniq.flatten.compact
|
@categories ||=
|
||||||
|
topics.map { |t| [t.category, t.category&.parent_category] }.uniq.flatten.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_topics
|
def load_topics
|
||||||
|
|
Loading…
Reference in New Issue
Block a user