From ff16799fdb7cdec11958a7e0194540a8aed18d4a Mon Sep 17 00:00:00 2001
From: Torben Hansen <derhansen@gmail.com>
Date: Wed, 17 Nov 2021 08:42:57 +0100
Subject: [PATCH] [BUGFIX] Fix undefined array key warning in
 ImageContentObject

Ensure the first argument passed to $this->cImage() is a
string if file is not defined in conf array.

Resolves: #96008
Releases: master
Change-Id: Icf84fd7fad66da4f248e3216ab4b79ac995a69c1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72200
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
---
 .../frontend/Classes/ContentObject/ImageContentObject.php       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php
index 241d4c569728..0b9b2c54e17e 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php
@@ -39,7 +39,7 @@ class ImageContentObject extends AbstractContentObject
             return '';
         }
 
-        $theValue = $this->cImage($conf['file'], $conf);
+        $theValue = $this->cImage($conf['file'] ?? '', $conf);
         if (isset($conf['stdWrap.'])) {
             $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
         }
-- 
GitLab