From 9e6f0460c232ecbabfdc2a2be6b6f1637dadff51 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 31 Oct 2018 14:32:11 -0400 Subject: [PATCH] Ensure the Lang class always exists when throwing exceptions --- lib/AbstractException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AbstractException.php b/lib/AbstractException.php index a431060..38ff02b 100644 --- a/lib/AbstractException.php +++ b/lib/AbstractException.php @@ -93,7 +93,7 @@ abstract class AbstractException extends \Exception { $code = self::CODES[$codeID]; $msg = "Exception.".str_replace("\\", "/", $class).".$msgID"; } - $msg = Arsse::$lang->msg($msg, $vars); + $msg = (Arsse::$lang ?? new Lang)->msg($msg, $vars); } parent::__construct($msg, $code, $e); }