From 40d679844bd8f09f0ed90cca8d5adee9fad5df47 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 a4310603..38ff02bb 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); }