From 9c43bfc8f5fffc2ff46414b2ec47273628f2285d Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 10 Aug 2022 18:46:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20runtime=20crash=20if=20$GL?= =?UTF-8?q?OBALS:=20TSFE=20is=20not=20set=20on=20PHP=208=20and=20higher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the case for the backend. Setting it to null yields to an early abortion in the addLibrary function. --- Classes/Hooks/PageRendererPreProcess.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Hooks/PageRendererPreProcess.php b/Classes/Hooks/PageRendererPreProcess.php index 1379a9e..5dc4a0a 100644 --- a/Classes/Hooks/PageRendererPreProcess.php +++ b/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