From 83a7fb45869219b832c3ccd75d9da79e20b34f2c Mon Sep 17 00:00:00 2001 From: Oliver Gassner | p2n Date: Mon, 30 Mar 2026 14:00:28 +0200 Subject: [PATCH] Prevent Exception from getUri() in Cli-Context Additionally check if we are running in cli. Without it cli tasks which build a fake FE/BE Request fail. --- Classes/Integration/Typo3Integration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Integration/Typo3Integration.php b/Classes/Integration/Typo3Integration.php index 664ae87..d06d6d5 100644 --- a/Classes/Integration/Typo3Integration.php +++ b/Classes/Integration/Typo3Integration.php @@ -37,7 +37,7 @@ public function setupOnce(): void private function processEvent(Event $event): void { $request = $this->getServerRequest(); - if ($request instanceof ServerRequestInterface) { + if (!Environment::isCli() && $request instanceof ServerRequestInterface) { if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) { $event->setTag('request_type', 'frontend'); $this->setUrl($event, $request);