diff --git a/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionManager.php b/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionManager.php index 486faad7ccb1..3ff69d12298f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionManager.php +++ b/src/Symfony/Bundle/FrameworkBundle/Debug/ExceptionManager.php @@ -29,7 +29,7 @@ class ExceptionManager protected $logger; protected $currentContent; - public function __construct(\Exception $exception, Request $request, DebugLoggerInterface $logger) + public function __construct(\Exception $exception, Request $request, DebugLoggerInterface $logger = null) { $this->exception = $exception; $this->request = $request; @@ -58,11 +58,15 @@ public function getLogger() public function getLogs() { - return $this->logger->getLogs(); + return null === $this->logger ? array() : $this->logger->getLogs(); } public function countErrors() { + if (null === $this->logger) { + return 0; + } + $errors = 0; foreach ($this->logger->getLogs() as $log) { if ('ERR' === $log['priorityName']) {