We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3243682 + 84e6869 commit 10708bfCopy full SHA for 10708bf
1 file changed
src/EventListener/FlashMessageListener.php
@@ -13,6 +13,7 @@
13
14
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15
use Symfony\Component\HttpFoundation\Cookie;
16
+use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
17
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
18
use Symfony\Component\HttpFoundation\Session\Session;
19
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
@@ -82,7 +83,12 @@ public function onKernelResponse(FlashMessageResponseEvent $event)
82
83
return;
84
}
85
- $session = $this->session ?: $event->getRequest()->getSession();
86
+ try {
87
+ $session = $this->session ?: $event->getRequest()->getSession();
88
+ } catch (SessionNotFoundException $e) {
89
+ return;
90
+ }
91
+
92
if (null === $session) {
93
94
0 commit comments