Skip to content

Commit

Permalink
Fix issue with 500 error when session not exists in request object
Browse files Browse the repository at this point in the history
  • Loading branch information
Paweł Mikołajczuk committed Nov 9, 2015
1 parent 2cda2d3 commit b3c1e2e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function onRequest(GetResponseEvent $event)

} else {
// Session language
if ($session->has('languageCode')) {
if ($session && $session->has('languageCode')) {
$languageCode = $session->get('languageCode');
}

Expand Down Expand Up @@ -101,7 +101,9 @@ public function onRequest(GetResponseEvent $event)
$languageCode = $publicationMetadata['publication']['code_default_language'];
}

$session->set('languageCode', $languageCode);
if ($session) {
$session->set('languageCode', $languageCode);
}
}

if (!is_null($languageCode)) {
Expand Down

0 comments on commit b3c1e2e

Please sign in to comment.