Skip to content

Commit 3ec514f

Browse files
committed
BUGFIX: Prevent render error if asset is not set in ImageTag
As the thumbnail is generated within „context“ conditions don’t apply yet which could prevent the rendering and therefore the error.
1 parent a0f6a69 commit 3ec514f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Neos.Media/Classes/Eel/ImageHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ImageHelper implements ProtectedContextAwareInterface
4141
* @throws ThumbnailServiceException
4242
*/
4343
public function createThumbnail(
44-
AssetInterface $asset,
44+
?AssetInterface $asset,
4545
?string $preset = null,
4646
?int $width = null,
4747
?int $maximumWidth = null,

Neos.Neos/Resources/Private/Fusion/Prototypes/ImageTag.fusion

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ prototype(Neos.Neos:ImageTag) < prototype(Neos.Fusion:Tag) {
1010
async = false
1111
quality = NULL
1212
preset = NULL
13-
@context.thumbnail = ${Neos.Media.Image.createThumbnail(
13+
@context.thumbnail = ${this.asset ? Neos.Media.Image.createThumbnail(
1414
this.asset,
1515
this.preset,
1616
this.width,
@@ -22,7 +22,7 @@ prototype(Neos.Neos:ImageTag) < prototype(Neos.Fusion:Tag) {
2222
this.async,
2323
this.quality,
2424
this.format
25-
)}
25+
) : null}
2626

2727
tagName = 'img'
2828
attributes {

0 commit comments

Comments
 (0)