Olivier Massot 1 год назад
Родитель
Сommit
5fa6c58600
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/State/Processor/Organization/OrganizationCreationRequestProcessor.php

+ 2 - 2
src/State/Processor/Organization/OrganizationCreationRequestProcessor.php

@@ -38,11 +38,11 @@ class OrganizationCreationRequestProcessor implements ProcessorInterface
             throw new \RuntimeException('not supported', Response::HTTP_METHOD_NOT_ALLOWED);
             throw new \RuntimeException('not supported', Response::HTTP_METHOD_NOT_ALLOWED);
         }
         }
 
 
-        /** @var Access $access */
+        /** @var Access|null $access */
         $access = $this->security->getUser();
         $access = $this->security->getUser();
 
 
         $organizationCreationRequest->setCreationDate(DatesUtils::new());
         $organizationCreationRequest->setCreationDate(DatesUtils::new());
-        $organizationCreationRequest->setAuthorId($access->getId());
+        $organizationCreationRequest->setAuthorId($access?->getId());
 
 
         if ($organizationCreationRequest->isAsync()) {
         if ($organizationCreationRequest->isAsync()) {
             // Send the export request to Messenger (@see App\Message\Handler\OrganizationCreationHandler)
             // Send the export request to Messenger (@see App\Message\Handler\OrganizationCreationHandler)