about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2017-07-26 16:14:39 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-07-26 16:14:39 +0200
commit8b43d6bf9c3c85b093ae9581d7400776aaa97322 (patch)
tree7720f7f8056c61412ada5654ee250daf3f992a95 /app
parentb8adb4d7fa6546f415d93d0af8e1d7b0e24a3f54 (diff)
fix(web_push_notification_worker): Guard against deleted notifications (#4379)
Diffstat (limited to 'app')
-rw-r--r--app/workers/web_push_notification_worker.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/web_push_notification_worker.rb b/app/workers/web_push_notification_worker.rb
index da4043ddb..51b8daae7 100644
--- a/app/workers/web_push_notification_worker.rb
+++ b/app/workers/web_push_notification_worker.rb
@@ -9,6 +9,8 @@ class WebPushNotificationWorker
     session_activation = SessionActivation.find(session_activation_id)
     notification = Notification.find(notification_id)
 
+    return if session_activation.nil? || notification.nil?
+
     begin
       session_activation.web_push_subscription.push(notification)
     rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription => e