From cffd216aa9f032dbd5760dd52664c597c99c6229 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 6 Apr 2020 21:42:15 +0200 Subject: [PATCH] Exception handling: Fixed error if handler not initialized (use Legacy handler as fallback) --- src/Exceptions/Handler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Exceptions/Handler.php b/src/Exceptions/Handler.php index f8905531..4a063bf4 100644 --- a/src/Exceptions/Handler.php +++ b/src/Exceptions/Handler.php @@ -3,6 +3,7 @@ namespace Engelsystem\Exceptions; use Engelsystem\Exceptions\Handlers\HandlerInterface; +use Engelsystem\Exceptions\Handlers\Legacy; use Engelsystem\Http\Request; use ErrorException; use Throwable; @@ -66,7 +67,7 @@ class Handler $this->request = new Request(); } - $handler = $this->handler[$this->environment]; + $handler = isset($this->handler[$this->environment]) ? $this->handler[$this->environment] : new Legacy(); $handler->report($e); ob_start(); $handler->render($this->request, $e);