FIX: Ensures we have a post before destroying it
This commit is contained in:
parent
f711077d48
commit
47b004a1ef
|
@ -18,7 +18,10 @@ module Jobs
|
|||
topic = op.topic
|
||||
post = topic.posts.find_by(post_number: post_number)
|
||||
DiscourseSimpleCalendar::EventDestroyer.destroy(op, post_number.to_s)
|
||||
PostDestroyer.new(Discourse.system_user, post).destroy
|
||||
|
||||
if post
|
||||
PostDestroyer.new(Discourse.system_user, post).destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue