From ef3baf4e62bd7d19fe466cd91b9fa25572e8707f Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 7 Sep 2008 00:38:57 +0000 Subject: [PATCH] Add more error handling --- includes/filerepo/FileRepo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 23a132eae5..02d0d1fbb0 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -101,7 +101,7 @@ abstract class FileRepo { # Now try an old version of the file if ( $time !== false ) { $img = $this->newFile( $title, $time ); - if ( $img->exists() ) { + if ( $img && $img->exists() ) { if ( !$img->isDeleted(File::DELETED_FILE) ) { return $img; } else if ( ($flags & FileRepo::FIND_PRIVATE) && $img->userCan(File::DELETED_FILE) ) { -- 2.20.1