File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ public function onKernelException(ExceptionEvent $event)
113
113
$ backtrace ->setFileContent ($ this ->buildBacktrace ($ event ));
114
114
115
115
// Unset the used session variable
116
- $ session = $ event ->getRequest ()->getSession ();
116
+ $ request = $ event ->getRequest ();
117
+ $ session = $ request ->hasSession () ? $ request ->getSession () : null ;
117
118
if ($ session ) {
118
119
$ session ->remove (self ::SESSION_FILENAME );
119
120
$ session ->set (self ::SESSION_ERROR , $ exception ->getMessage ());
@@ -204,7 +205,7 @@ public function onKernelResponse(ResponseEvent $responseObject)
204
205
$ response = $ responseObject ->getResponse ();
205
206
$ request = $ responseObject ->getRequest ();
206
207
$ statusCode = $ response ->getStatusCode ();
207
- $ session = $ request ->getSession ();
208
+ $ session = $ request ->hasSession () ? $ request -> getSession () : null ;
208
209
209
210
if (!$ this ->configuration ->isProductionEnvironment ()) {
210
211
// no production! -> don't sent an email
You can’t perform that action at this time.
0 commit comments