Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Better condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Jirka Koutny committed Nov 27, 2015
1 parent 187b49e commit 6cb1f05
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions KernelExceptionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public function onKernelException(GetResponseForExceptionEvent $event)
$exception = $event->getException();

if (Debugger::isEnabled() && !$this->isIgnoredException($exception)) {
$this->storeUsernameInServerVariable();
if ($this->storeUsernameInServerVariable && $this->tokenStorage !== null) {
$this->storeUsernameInServerVariable();
}

if (Debugger::$productionMode === true) {
Debugger::log($exception, Debugger::ERROR);
Expand Down Expand Up @@ -56,9 +58,6 @@ private function isIgnoredException(Exception $exception)

private function storeUsernameInServerVariable()
{
if (null === $this->tokenStorage || !$this->storeUsernameInServerVariable) {
return;
}
$token = $this->tokenStorage->getToken();

if ($token) {
Expand Down

0 comments on commit 6cb1f05

Please sign in to comment.