From 04f3b6154a38089f96373b772473f2819a45a1b9 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Mon, 13 Jun 2005 06:38:02 +0000 Subject: [PATCH] BUG#2292 - catch 'null' return values for getThumbnail() --- includes/ImagePage.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 6e8276ec62..b1a03a77e9 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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. -- 2.20.1