Skip to content

Commit da2f122

Browse files
authored
[BUGFIX] Add check if generator is valid before traversing it
If there's no solr configuration for any site, saving pages or content results in a PHP exception: Uncaught TYPO3 Exception: Cannot traverse an already closed generator | Exception thrown in file .../Classes/Domain/Site/SiteRepository.php in line 135 The added check prevents this error.
1 parent 1f3a281 commit da2f122

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Classes/Domain/Site/SiteRepository.php

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ public function getAvailableSites(bool $stopOnInvalidSite = false): array
132132
$siteGenerator->rewind();
133133

134134
$sites = [];
135+
if (!$siteGenerator->valid()) {
136+
return $sites;
137+
}
135138
foreach ($siteGenerator as $rootPageId => $site) {
136139
if (isset($sites[$rootPageId])) {
137140
//get each site only once

0 commit comments

Comments
 (0)