Browse Source

fix(web_push_notification_worker): Guard against deleted notifications (#4379)

pull/4/head
Sorin Davidoi 6 years ago
committed by Eugen Rochko
parent
commit
8b43d6bf9c
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      app/workers/web_push_notification_worker.rb

+ 2
- 0
app/workers/web_push_notification_worker.rb View File

@ -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

Loading…
Cancel
Save