From 554ff3f6a648ecba58d683536e4dc3d74c537128 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 21 May 2008 22:36:53 +0000 Subject: [PATCH] Don't assume the file repository will always return an object when checking for dupes --- includes/ImagePage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a9070dae04..3b0c6b7bfb 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -552,10 +552,11 @@ EOT function checkSharedConflictCallback( $repo ) { $this->loadFile(); $dupfile = $repo->newFile( $this->img->getTitle() ); - if( $dupfile->exists() ) { + if( $dupfile && $dupfile->exists() ) { $this->dupFile = $dupfile; + return $dupfile->exists(); } - return $dupfile->exists(); + return false; } function getUploadUrl() { -- 2.20.1