mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 19:23:41 +01:00
fix(web_push_notification_worker): Guard against deleted notifications (#4379)
This commit is contained in:
parent
b8adb4d7fa
commit
8b43d6bf9c
1 changed files with 2 additions and 0 deletions
|
@ -9,6 +9,8 @@ class WebPushNotificationWorker
|
||||||
session_activation = SessionActivation.find(session_activation_id)
|
session_activation = SessionActivation.find(session_activation_id)
|
||||||
notification = Notification.find(notification_id)
|
notification = Notification.find(notification_id)
|
||||||
|
|
||||||
|
return if session_activation.nil? || notification.nil?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
session_activation.web_push_subscription.push(notification)
|
session_activation.web_push_subscription.push(notification)
|
||||||
rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription => e
|
rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription => e
|
||||||
|
|
Loading…
Reference in a new issue