When reporting exceptions that occur during initialization, wgUser may
be null. Don't die when that happens.
Change-Id: I65d5a17d80f9021e28a218c7a5a17e399bc7ce98
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();