diff --git a/Listener/Log/LogListener.php b/Listener/Log/LogListener.php index e9d19cc68..08ea110f8 100644 --- a/Listener/Log/LogListener.php +++ b/Listener/Log/LogListener.php @@ -108,7 +108,7 @@ private function createLog(LogGenericEvent $event) if (!($event->getAction() === LogUserDeleteEvent::ACTION && $event->getReceiver() === $doer)) { //Prevent self delete case //Sometimes, the entity manager has been cleared, so we must merge the doer. - $doer = $this->om->merge($doer); + if ($doer) $doer = $this->om->merge($doer); $log->setDoer($doer); } $log->setDoerType($doerType);