Skip to content

Commit

Permalink
Catch null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed May 29, 2018
1 parent 47dd3ab commit 12ec90c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Action/AuthSuccessAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ public function __invoke(): Response
return $this->redirectToRoute('core23_lastfm_error');
}

$event = new AuthSuccessEvent($this->sessionManager->getSession());
$session = $this->sessionManager->getSession();

if (null === $session) {
return $this->redirectToRoute('core23_lastfm_error');
}

$event = new AuthSuccessEvent($session);
$this->eventDispatcher->dispatch(Core23LastFmEvents::AUTH_SUCCESS, $event);

if ($response = $event->getResponse()) {
Expand Down

0 comments on commit 12ec90c

Please sign in to comment.