diff --git a/app/jobs/regular/post_alert.rb b/app/jobs/regular/post_alert.rb index 36785df4e4f..30cef2534b1 100644 --- a/app/jobs/regular/post_alert.rb +++ b/app/jobs/regular/post_alert.rb @@ -3,10 +3,8 @@ module Jobs def execute(args) # maybe it was removed by the time we are making the post - if post = Post.find(args[:post_id]) - # maybe the topic was deleted, so skip in that case as well - PostAlerter.post_created(post) if post.topic - end + post = Post.where(id: args[:post_id]).first + PostAlerter.post_created(post) if post && post.topic end end