diff --git a/src/LogListener.php b/src/LogListener.php index 96ceef7..c389b77 100644 --- a/src/LogListener.php +++ b/src/LogListener.php @@ -132,8 +132,8 @@ public function log(EventInterface $event) } if ($event instanceof MvcEvent) { assert($event instanceof MvcEvent); - /** @var Exception $ex */ - $ex = $params['exception']; + /** @var Exception|null $ex */ + $ex = $params['exception'] ?? null; if ($ex instanceof Throwable || $ex instanceof Exception) { /**