mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Error when trying to bump a topic with no category (#21207)
When revising a post, if the topic that post belonged to did not have a category attached it would error with > NoMethodError (undefined method `read_restricted' for nil:NilClass)
This commit is contained in:
@@ -579,6 +579,8 @@ class TopicTrackingState
|
||||
def self.secure_category_group_ids(topic)
|
||||
category = topic.category
|
||||
|
||||
return [Group::AUTO_GROUPS[:admins]] if category.nil?
|
||||
|
||||
if category.read_restricted
|
||||
ids = [Group::AUTO_GROUPS[:admins]]
|
||||
ids.push(*category.secure_group_ids)
|
||||
|
||||
Reference in New Issue
Block a user