Explorar el Código

correction erreur booking avec rien

garthh hace 17 horas
padre
commit
594eb07807
Se han modificado 2 ficheros con 4 adiciones y 0 borrados
  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];