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.
This commit is contained in:
Julien Fastré 2022-02-14 14:22:33 +01:00
parent 68d0c66402
commit 844650b685

View File

@ -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);