From cd94b626e98cc34d85e0e076e45e961042da844f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 31 Jul 2016 02:06:10 +0200 Subject: [PATCH] ImageListPager: Don't fatal when unable to thumbnail a file Change-Id: I2e2879de2b0dd4cd347bf545c46c98b891def9eb --- includes/specials/pagers/ImageListPager.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 40706faaa0..5e10269cad 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -429,8 +429,11 @@ class ImageListPager extends TablePager { // If statement for paranoia if ( $file ) { $thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] ); - - return $thumb->toHtml( [ 'desc-link' => true ] ); + if ( $thumb ) { + return $thumb->toHtml( [ 'desc-link' => true ] ); + } else { + return wfMessage( 'thumbnail_error', '' )->escaped(); + } } else { return htmlspecialchars( $value ); } -- 2.20.1