ImageListPager: Don't fatal when unable to thumbnail a file
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 31 Jul 2016 00:06:10 +0000 (02:06 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sun, 31 Jul 2016 00:10:16 +0000 (02:10 +0200)
Change-Id: I2e2879de2b0dd4cd347bf545c46c98b891def9eb

includes/specials/pagers/ImageListPager.php

index 40706fa..5e10269 100644 (file)
@@ -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 );
                                }