From 881539f1eff905a14371873df1d2ee721ec633d3 Mon Sep 17 00:00:00 2001 From: emilschn Date: Tue, 12 Mar 2024 15:07:47 +0100 Subject: [PATCH] add control to check if user is notified #2294 --- src/EventListener/ActivityListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventListener/ActivityListener.php b/src/EventListener/ActivityListener.php index 0e8c81a5c..e04c2ba83 100755 --- a/src/EventListener/ActivityListener.php +++ b/src/EventListener/ActivityListener.php @@ -221,7 +221,7 @@ private function isUserNotified($user, $entity): bool // - if entity is Suivi: we check that the partner of the user is different from the partner of the user who created the suivi return User::STATUS_ACTIVE === $user->getStatut() && !$user->isSuperAdmin() && !$user->isTerritoryAdmin() - && ($entity instanceof Affectation || $user->getPartner() !== $entity->getCreatedBy()->getPartner()); + && ($entity instanceof Affectation || ($entity->getCreatedBy() && $user->getPartner() !== $entity->getCreatedBy()->getPartner())); } public function preRemove(LifecycleEventArgs $args)