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