Skip to content

Commit

Permalink
Check whether a request has a session to prevent deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Feijten committed Jun 10, 2018
1 parent aff914d commit cbe7ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbe7ba6

Please # to comment.