Revision::newFromTitle may return null

Bug: T176882
Change-Id: I9aea25c2db81a12f16414edcb279f3241dc380bc
This commit is contained in:
jdlrobson 2017-09-27 14:47:01 -05:00 committed by Jdlrobson
parent 8e22f9bd49
commit 606e72ab68
1 changed files with 6 additions and 1 deletions

View File

@ -746,7 +746,12 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
$historyUrl = $title->getLocalURL( [ 'action' => 'history' ] );
}
$editor = $this->getRevisionEditor( Revision::newFromTitle( $title ) );
$rev = Revision::newFromTitle( $title );
if ( $rev ) {
$editor = $this->getRevisionEditor( $rev );
} else {
$editor = false;
}
return [
// Use $edit['timestamp'] (Unix format) instead of $timestamp (MW format)
'data-timestamp' => $isMainPage ? '' : wfTimestamp( TS_UNIX, $timestamp ),