From a54af8db895ecdbfe862c5d767c28d4fa01be061 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Fri, 15 Sep 2023 12:32:02 +0200
Subject: [PATCH] [BUGFIX] Avoid notice in ContentObjectRenderer::listNum

Resolves: #101925
Releases: main, 12.4, 11.5
Change-Id: Icec9f634ca1e1a9c7ad6b3a55afaf197cfa44acc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81045
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../frontend/Classes/ContentObject/ContentObjectRenderer.php    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index 86f8639625eb..9b34f151cd1f 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -2739,7 +2739,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
             $listNum = (string)random_int(0, count($temp) - 1);
         }
         $index = $this->calc(str_ireplace('last', $last, $listNum));
-        return $temp[$index];
+        return $temp[$index] ?? '';
     }
 
     /**
-- 
GitLab