Skip to content

Commit eac4b6a

Browse files
committed
fix: empty request
1 parent 1aa75b7 commit eac4b6a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Classes/Service/VariablesService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use TYPO3\CMS\Core\Database\Connection;
1212
use TYPO3\CMS\Core\Database\ConnectionPool;
1313
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
14+
use TYPO3\CMS\Core\Http\RequestFactory;
1415
use TYPO3\CMS\Core\Utility\GeneralUtility;
1516
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
1617

@@ -29,7 +30,7 @@ class VariablesService
2930
protected ?array $markerKeys = null;
3031
protected ?string $markerRegexp = null;
3132

32-
public function __construct()
33+
public function __construct(private readonly RequestFactory $request)
3334
{
3435
$this->cacheTags = new Set('string');
3536
}
@@ -144,7 +145,7 @@ protected function getMarkers(): MarkerCollection
144145
return $page['uid'];
145146
}, $this->typoScriptFrontendController->rootLine);
146147

147-
if (!empty($GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript')->getSetupArray()['plugin.']['tx_variables.']['persistence.']['storagePid'])) {
148+
if (!empty($GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript')?->getSetupArray()['plugin.']['tx_variables.']['persistence.']['storagePid'])) {
148149
$pids[] = (int)$GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.typoscript')->getSetupArray()['plugin.']['tx_variables.']['persistence.']['storagePid'];
149150
}
150151

0 commit comments

Comments
 (0)