diff --git a/Classes/IndexQueue/Indexer.php b/Classes/IndexQueue/Indexer.php index 3192ffbfe1..47fee61d68 100644 --- a/Classes/IndexQueue/Indexer.php +++ b/Classes/IndexQueue/Indexer.php @@ -259,9 +259,14 @@ protected function getItemRecordOverlayed(Item $item, int $language): ?array $pidToUse = $this->getPageIdOfItem($item); - return GeneralUtility::makeInstance(Tsfe::class) - ->getTsfeByPageIdAndLanguageId($pidToUse, $language, $item->getRootPageUid()) - ->sys_page->getLanguageOverlay($item->getType(), $itemRecord); + $globalTsfe = GeneralUtility::makeInstance(Tsfe::class); + $specializedTsfe = $globalTsfe->getTsfeByPageIdAndLanguageId($pidToUse, $language, $item->getRootPageUid()); + + if ($specializedTsfe === null) { + return null; + } + + return $specializedTsfe->sys_page->getLanguageOverlay($item->getType(), $itemRecord); } protected function isAFreeContentModeItemRecord(Item $item): bool