mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
do not add referrer if user is null (fix condition)
This commit is contained in:
parent
efeda81e05
commit
704392a729
@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\EventListener;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
@ -25,7 +26,7 @@ class AccompanyingPeriodWorkEventListener
|
||||
|
||||
public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void
|
||||
{
|
||||
if (null !== $this->security->getUser()) {
|
||||
if ($this->security->getUser() instanceof User) {
|
||||
$work->addReferrer($this->security->getUser());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user