File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Neos.Neos/Resources/Private/Fusion/Prototypes Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff 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 ,
@@ -53,6 +53,9 @@ public function createThumbnail(
5353 int $ quality = null ,
5454 string $ format = null
5555 ): ?ImageInterface {
56+ if (!$ asset instanceof AssetInterface) {
57+ return null ;
58+ }
5659 if (!empty ($ preset )) {
5760 $ thumbnailConfiguration = $ this ->thumbnailService ->getThumbnailConfigurationForPreset ($ preset );
5861 } else {
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments