Skip to content

Commit

Permalink
Merge pull request #16 from drsdre/drsdre-previousUrl-patch
Browse files Browse the repository at this point in the history
Prevent error when session has expired
  • Loading branch information
denisdulici authored Nov 2, 2019
2 parents 9273cc8 + 2b5202e commit d578be3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Controllers/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public function back($locale, Request $request)

$session->setPreviousUrl($url);
}

return redirect($session->previousUrl());
return redirect(
$session->previousUrl()
? $session->previousUrl()
: (config('language.url') ? url('/' . $locale) : url('/'))
);
}
}

0 comments on commit d578be3

Please sign in to comment.