diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index 203575a09046..17b51c8ed034 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -3756,10 +3756,12 @@ public function getImgResource($file, $fileArray) try { $theImage = GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize($file); $info = GeneralUtility::makeInstance(GifBuilder::class)->imageMagickConvert($theImage, 'WEB'); - $info['origFile'] = $theImage; - // This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash. - $info['origFile_mtime'] = @filemtime(Environment::getPublicPath() . '/' . $theImage); - $imageResource = $info; + if ($info !== null) { + $info['origFile'] = $theImage; + // This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash. + $info['origFile_mtime'] = @filemtime(Environment::getPublicPath() . '/' . $theImage); + $imageResource = $info; + } } catch (Exception $e) { // do nothing in case the file path is invalid }