FIX: Unable to move pm to public topic (#24903)

* FIX: guard against empty category_ids when creating small action post for changing of category

Co-authored-by: Kelvin Tan <kelv@discourse.org>
This commit is contained in:
Blake Erickson
2023-12-14 12:31:38 -07:00
committed by GitHub
parent 5417c4fac0
commit 7aeb5d6012
2 changed files with 14 additions and 1 deletions

View File

@@ -154,7 +154,9 @@ class PostRevisor
end
def self.create_small_action_for_category_change(topic:, user:, old_category:, new_category:)
return if !SiteSetting.create_post_for_category_and_tag_changes
if !old_category || !new_category || !SiteSetting.create_post_for_category_and_tag_changes
return
end
topic.add_moderator_post(
user,