From: Brion Vibber Date: Wed, 21 May 2008 22:36:53 +0000 (+0000) Subject: Don't assume the file repository will always return an object when checking for dupes X-Git-Tag: 1.31.0-rc.0~47484 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=554ff3f6a648ecba58d683536e4dc3d74c537128;p=lhc%2Fweb%2Fwiklou.git Don't assume the file repository will always return an object when checking for dupes --- 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() {