From 5fb962a65fe7dedef9462ed8af0849dc3c2ed1fd Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 8 May 2014 16:27:17 -0400 Subject: [PATCH] FIX: Some extra safety - in the case that an imported post was deleted, don't error out of the PollFeed job --- app/models/topic_embed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/topic_embed.rb b/app/models/topic_embed.rb index 1cd1fddfb01..5260e195338 100644 --- a/app/models/topic_embed.rb +++ b/app/models/topic_embed.rb @@ -49,7 +49,7 @@ class TopicEmbed < ActiveRecord::Base absolutize_urls(url, contents) post = embed.post # Update the topic if it changed - if content_sha1 != embed.content_sha1 + if post && content_sha1 != embed.content_sha1 revisor = PostRevisor.new(post) revisor.revise!(user, absolutize_urls(url, contents), skip_validations: true, bypass_rate_limiter: true) embed.update_column(:content_sha1, content_sha1)