BUG#2292 - catch 'null' return values for getThumbnail()
authorJens Frank <jeluf@users.mediawiki.org>
Mon, 13 Jun 2005 06:38:02 +0000 (06:38 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Mon, 13 Jun 2005 06:38:02 +0000 (06:38 +0000)
includes/ImagePage.php

index 6e8276e..b1a03a7 100644 (file)
@@ -158,7 +158,11 @@ class ImagePage extends Article {
                                   && ( $width != $this->img->getWidth() || $height != $this->img->getHeight() ) ) {
                                        if( $wgUseImageResize ) {
                                                $thumbnail = $this->img->getThumbnail( $width );
-                                               $url = $thumbnail->getUrl();
+                                               if ( $thumbnail == null ) {
+                                                       $url = $full_url;
+                                               } else {
+                                                       $url = $thumbnail->getUrl();
+                                               }
                                        } else {
                                                # No resize ability? Show the full image, but scale
                                                # it down in the browser so it fits on the page.