FIX: Post without a topic can be destroyed.
This commit is contained in:
parent
52c70f8b45
commit
1b2b142f30
|
@ -47,7 +47,10 @@ class PostDestroyer
|
|||
mark_for_deletion
|
||||
end
|
||||
DiscourseEvent.trigger(:post_destroyed, @post, @opts, @user)
|
||||
DiscourseEvent.trigger(:topic_destroyed, @topic, @user) if @post.is_first_post?
|
||||
|
||||
if @post.is_first_post? && @post.topic
|
||||
DiscourseEvent.trigger(:topic_destroyed, @post.topic, @user)
|
||||
end
|
||||
end
|
||||
|
||||
def recover
|
||||
|
|
Loading…
Reference in New Issue