Make sure processResponsiveImages checks for valid thumb object
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 14 Aug 2014 20:24:50 +0000 (17:24 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 14 Sep 2014 21:40:27 +0000 (21:40 +0000)
If the thumbnail is an error (or worse yet, if the MediaHandler
returns false, like TMH does in certain circumstances), we
should not add responsive thumbnail links.

Change-Id: I2aafbd07e8435ce2d1b4cb32e49e98cb5f6c00ab

includes/Linker.php

index d9f4255..012bc1b 100644 (file)
@@ -897,7 +897,7 @@ class Linker {
         */
        public static function processResponsiveImages( $file, $thumb, $hp ) {
                global $wgResponsiveImages;
-               if ( $wgResponsiveImages ) {
+               if ( $wgResponsiveImages && $thumb && !$thumb->isError() ) {
                        $hp15 = $hp;
                        $hp15['width'] = round( $hp['width'] * 1.5 );
                        $hp20 = $hp;