Skip to content

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

FIX: Bulk deleting topics should ignore already deleted topics

Gerhard Schlager2927294cc632
diff --git a/lib/topics_bulk_action.rb b/lib/topics_bulk_action.rb
index ce801f1e071..4b2618710d5 100644
--- a/lib/topics_bulk_action.rb
+++ b/lib/topics_bulk_action.rb
@@ -136,7 +136,8 @@ class TopicsBulkAction
def delete
topics.each do |t|
if guardian.can_delete?(t)
- PostDestroyer.new(@user, t.ordered_posts.first).destroy
+ post = t.ordered_posts.first
+ PostDestroyer.new(@user, post).destroy if post
end
end
end
@@ -166,7 +167,7 @@ class TopicsBulkAction
if tags.present?
DiscourseTagging.tag_topic_by_names(t, guardian, tags, append: true)
end
- @changed_ids << t.id
+ @changed_ids << t.id
end
end
end