Skip denotify if recipient doesn't exist

This commit is contained in:
Karina Kwiatek 2022-07-14 23:53:02 +02:00 committed by Karina Kwiatek
parent d9f82c4985
commit 8005fc8ae6
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class Notification < ApplicationRecord
end end
def denotify(recipient, target) def denotify(recipient, target)
return nil if recipient.blank?
return nil unless target.respond_to? :notification_type return nil unless target.respond_to? :notification_type
notif_type = target.notification_type notif_type = target.notification_type