소스 검색

correction erreur booking avec rien

garthh 17 시간 전
부모
커밋
594eb07807
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 0 0
      public/pages/landing.md-dist
  2. 4 0
      src/Controller/MainController.php

+ 0 - 0
public/pages/landing.md-dist


+ 4 - 0
src/Controller/MainController.php

@@ -48,6 +48,10 @@ final class MainController extends AbstractController
         }
         // Récupérer la liste des événements visibles
         $events = $repository->findEventsToCome($onlyPublicAccess);
+        if (!$events) {
+            $this->addFlash('info', 'Aucun d\'événement n\'est plannifié pour le moment.');
+            return $this->redirectToRoute('app_main');
+        }
         $event = $events[0];