🐛 Fix runtime crash if $GLOBALS: TSFE is not set on PHP 8 and higher

This is the case for the backend.

Setting it to null yields to an early abortion in the addLibrary
function.
This commit is contained in:
Marcel Kapfer 2022-08-10 18:46:22 +02:00
parent 01c8997c1d
commit 9c43bfc8f5
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class PageRendererPreProcess
public function __construct(AssetCollector $assetCollector = null)
{
$this->assetCollector = $assetCollector ?? GeneralUtility::makeInstance(AssetCollector::class);
$this->tsfe = $GLOBALS['TSFE'];
$this->tsfe = $GLOBALS['TSFE'] ?? null;
}
public function addLibrary(): void