From b329e23f8511b7248c0e4aee370a9f8a249e1b84 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 14 May 2014 10:34:28 +1000 Subject: [PATCH] don't attempt to send emails on deleted topics --- app/jobs/regular/notify_mailing_list_subscribers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/jobs/regular/notify_mailing_list_subscribers.rb b/app/jobs/regular/notify_mailing_list_subscribers.rb index 040ac906624..90cd12d5af1 100644 --- a/app/jobs/regular/notify_mailing_list_subscribers.rb +++ b/app/jobs/regular/notify_mailing_list_subscribers.rb @@ -6,7 +6,8 @@ module Jobs post_id = args[:post_id] if post_id post = Post.with_deleted.find_by(id: post_id) - return if post && post.trashed? + # our topic can be deleted as well + return if (post && post.trashed?) || !post.topic end raise Discourse::InvalidParameters.new(:post_id) unless post