🐛 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.
main
Marcel Kapfer 4 months ago
parent 01c8997c1d
commit 9c43bfc8f5
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
  1. 2
      Classes/Hooks/PageRendererPreProcess.php

@ -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

Loading…
Cancel
Save