From: daniel Date: Thu, 29 Aug 2019 11:07:46 +0000 (+0200) Subject: Avoid fatal errors when reporting exceptions. X-Git-Tag: 1.34.0-rc.0~507 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=b860ef0d133c2e47c8897936324db3432e6573b3;p=lhc%2Fweb%2Fwiklou.git Avoid fatal errors when reporting exceptions. When reporting exceptions that occur during initialization, wgUser may be null. Don't die when that happens. Change-Id: I65d5a17d80f9021e28a218c7a5a17e399bc7ce98 --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index dfbc50a23f..3a6d8924ba 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -165,8 +165,8 @@ class MessageCache { global $wgUser; if ( !$this->mParserOptions ) { - if ( !$wgUser->isSafeToLoad() ) { - // $wgUser isn't unstubbable yet, so don't try to get a + if ( !$wgUser || !$wgUser->isSafeToLoad() ) { + // $wgUser isn't available yet, so don't try to get a // ParserOptions for it. And don't cache this ParserOptions // either. $po = ParserOptions::newFromAnon();