From c2665e2cb249f3f329dfdef8a22979d68172d115 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Thu, 14 Aug 2014 17:24:50 -0300 Subject: [PATCH] Make sure processResponsiveImages checks for valid thumb object 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Linker.php b/includes/Linker.php index d9f4255e68..012bc1ba64 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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; -- 2.20.1