diff --git a/app/workers/pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb
index f4e9a4cf2453bdc3caaffd3fb270dcf2ec97d89d..68e72f7382ff7d3f471c972caa93fb0a1d27a7d9 100644
--- a/app/workers/pipeline_notification_worker.rb
+++ b/app/workers/pipeline_notification_worker.rb
@@ -2,7 +2,9 @@ class PipelineNotificationWorker
   include Sidekiq::Worker
 
   def perform(pipeline_id, recipients = nil)
-    pipeline = Ci::Pipeline.find(pipeline_id)
+    pipeline = Ci::Pipeline.find_by(id: pipeline_id)
+
+    return unless pipeline
 
     NotificationService.new.pipeline_finished(pipeline, recipients)
   end