From 844650b6855cc63e27f094cc6041081876becfda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 14:22:33 +0100 Subject: [PATCH] fix sending notification when unsetting a referrer from a period When the user removes the referrer, a notification was send to a `null` addressee, which causes an unhandled exception. --- .../AccompanyingPeriod/Events/UserRefEventSubscriber.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php index 590874ab4..ce52fe5e0 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php @@ -60,6 +60,7 @@ class UserRefEventSubscriber implements EventSubscriberInterface { if ($period->hasPreviousUser() && $period->getUser() !== $this->security->getUser() + && null !== $period->getUser() && $period->getStep() !== AccompanyingPeriod::STEP_DRAFT ) { $this->generateNotificationToUser($period);