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)