🐛 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

View file

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