فهرست منبع

fix error when no logged user

Olivier Massot 1 سال پیش
والد
کامیت
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);
         }
 
-        /** @var Access $access */
+        /** @var Access|null $access */
         $access = $this->security->getUser();
 
         $organizationCreationRequest->setCreationDate(DatesUtils::new());
-        $organizationCreationRequest->setAuthorId($access->getId());
+        $organizationCreationRequest->setAuthorId($access?->getId());
 
         if ($organizationCreationRequest->isAsync()) {
             // Send the export request to Messenger (@see App\Message\Handler\OrganizationCreationHandler)