A platform for community discussion. Free, open, simple.
Handle topics without categories
jbrw17ab69929c4e
diff --git a/lib/topic_view.rb b/lib/topic_view.rbindex 0568e07a05f..14db18126ab 100644--- a/lib/topic_view.rb+++ b/lib/topic_view.rb@@ -431,7 +431,7 @@ class TopicViewdef category_group_moderator_user_ids@category_group_moderator_user_ids ||= begin- if SiteSetting.enable_category_group_moderation? && @topic.category.reviewable_by_group.present?+ if SiteSetting.enable_category_group_moderation? && @topic.category&.reviewable_by_group&.present?posts_user_ids = Set.new(@posts.map(&:user_id))Set.new(@topic.category.reviewable_by_group.group_users.where(user_id: posts_user_ids).pluck('distinct user_id')