diff --git a/Controller/Controller.php b/Controller/Controller.php index aea785f0..d760ce9b 100644 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -68,7 +68,7 @@ public function __construct($serializer, ExposedRoutesExtractorInterface $expose */ public function indexAction(Request $request, $_format) { - $session = $request->getSession(); + $session = $request->hasSession() ? $request->getSession() : null; if ($request->hasPreviousSession() && $session->getFlashBag() instanceof AutoExpireFlashBag) { // keep current flashes for one more request if using AutoExpireFlashBag