diff --git a/app/jobs/regular/publish_topic_to_category.rb b/app/jobs/regular/publish_topic_to_category.rb index 9127b6841e7..a98f0dddff9 100644 --- a/app/jobs/regular/publish_topic_to_category.rb +++ b/app/jobs/regular/publish_topic_to_category.rb @@ -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? diff --git a/spec/jobs/publish_topic_to_category_spec.rb b/spec/jobs/publish_topic_to_category_spec.rb index ebb5e79663b..84158e9adb8 100644 --- a/spec/jobs/publish_topic_to_category_spec.rb +++ b/spec/jobs/publish_topic_to_category_spec.rb @@ -20,13 +20,6 @@ RSpec.describe Jobs::PublishTopicToCategory do SiteSetting.queue_jobs = true end - describe 'when topic_timer_id is invalid' do - it 'should raise the right error' do - expect { described_class.new.execute(topic_timer_id: -1) } - .to raise_error(Discourse::InvalidParameters) - end - end - describe 'when topic has been deleted' do it 'should not publish the topic to the new category' do freeze_time 1.hour.ago