* Fixes regression from
7508b86ad3
Change-Id: I60c106b5b27db067b1884af95f5fb74a0a682a9a
# Now try an old version of the file
if ( $time !== false ) {
$img = $this->newFile( $title, $time );
- $img->load( $flags );
+ if ( $img ) {
+ $img->load( $flags );
+ }
if ( $img && $img->exists() ) {
if ( !$img->isDeleted( File::DELETED_FILE ) ) {
return $img; // always OK
$redir = $this->checkRedirect( $title );
if ( $redir && $title->getNamespace() == NS_FILE ) {
$img = $this->newFile( $redir );
- $img->load( $flags );
if ( !$img ) {
return false;
}
+ $img->load( $flags );
if ( $img->exists() ) {
$img->redirectedFrom( $title->getDBkey() );