浏览代码

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];