From 55c473e0f5095228d0952e87277a056f5227f354 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 29 Dec 2022 03:31:33 +0100 Subject: [PATCH] don't create notifications from muted user --- app/models/notification.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index 514c1d32..33268590 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -53,9 +53,9 @@ class Notification < ApplicationRecord def get_notification_owner(target) if target.is_a? User target - elsif target&.user.is_a? User + elsif target.try(:user) && target.user.is_a?(User) target.user - elsif target&.source.is_a? User + elsif target.try(:source) && target.source.is_a?(User) target.source else nil