From 0c65c4d92e15ac7c6266dfb132922a435936b68e Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 18 Apr 2013 11:34:40 +1000 Subject: [PATCH] fix error --- lib/jobs/process_post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jobs/process_post.rb b/lib/jobs/process_post.rb index 5451bb7f4..d11d3cb31 100644 --- a/lib/jobs/process_post.rb +++ b/lib/jobs/process_post.rb @@ -7,7 +7,8 @@ module Jobs def execute(args) post = Post.where(id: args[:post_id]).first - return unless post.present? + # two levels of deletion + return unless post.present? && post.topic.present? if args[:cook].present? post.update_column(:cooked, post.cook(post.raw, topic_id: post.topic_id))