Check for error before outputting srcset urls
If $thumb returns a MediaTransformError object, then $thumb->getUrl() will return false, which will result in srcset="1.5x, 2x". Bug: 67081 Change-Id: Idb6bbff6995536d20dac67ce12592f68f6d1235a
This commit is contained in:
parent
3fd9ff66f5
commit
3f659fb963
1 changed files with 2 additions and 2 deletions
|
|
@ -913,10 +913,10 @@ class Linker {
|
|||
|
||||
$thumb15 = $file->transform( $hp15 );
|
||||
$thumb20 = $file->transform( $hp20 );
|
||||
if ( $thumb15 && $thumb15->getUrl() !== $thumb->getUrl() ) {
|
||||
if ( $thumb15 && !$thumb15->isError() && $thumb15->getUrl() !== $thumb->getUrl() ) {
|
||||
$thumb->responsiveUrls['1.5'] = $thumb15->getUrl();
|
||||
}
|
||||
if ( $thumb20 && $thumb20->getUrl() !== $thumb->getUrl() ) {
|
||||
if ( $thumb20 && !$thumb20->isError() && $thumb20->getUrl() !== $thumb->getUrl() ) {
|
||||
$thumb->responsiveUrls['2'] = $thumb20->getUrl();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue