Don't assume the file repository will always return an object when checking for dupes
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 21 May 2008 22:36:53 +0000 (22:36 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 21 May 2008 22:36:53 +0000 (22:36 +0000)
includes/ImagePage.php

index a9070da..3b0c6b7 100644 (file)
@@ -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() {