FIX: Don't run job if topic timer has already been deleted.

This commit is contained in:
Guo Xiang Tan
2017-11-30 15:26:26 +08:00
parent 853b51b519
commit c128e421c4
2 changed files with 1 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ module Jobs
class PublishTopicToCategory < Jobs::Base
def execute(args)
topic_timer = TopicTimer.find_by(id: args[:topic_timer_id] || args[:topic_status_update_id])
raise Discourse::InvalidParameters.new(:topic_timer_id) if topic_timer.blank?
return if topic_timer.blank?
topic = topic_timer.topic
return if topic.blank?