Change-Id: I2e2879de2b0dd4cd347bf545c46c98b891def9eb
// If statement for paranoia
if ( $file ) {
$thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
// 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 );
}
} else {
return htmlspecialchars( $value );
}