Merge "Allow partially blocked users to tag unrelated revisions"
[lhc/web/wiklou.git] / includes / cache / MessageCache.php
index dfbc50a..848d9c9 100644 (file)
@@ -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();
@@ -1191,6 +1191,7 @@ class MessageCache {
                        $class = $wgParserConf['class'];
                        if ( $class == ParserDiffTest::class ) {
                                # Uncloneable
+                               // @phan-suppress-next-line PhanTypeMismatchProperty
                                $this->mParser = new $class( $wgParserConf );
                        } else {
                                $this->mParser = clone $parser;