Skip to content

Commit

Permalink
Handle null site resolvers.
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Aug 3, 2023
1 parent 1251912 commit 0720433
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/next/src/Render/MainContent/HtmlRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ protected function prepare(array $main_content, Request $request, RouteMatchInte
}

$next_entity_type_config = $this->nextEntityTypeManager->getConfigForEntityType($entity->getEntityTypeId(), $entity->bundle());
if (!$next_entity_type_config) {
if (!$next_entity_type_config || !$next_entity_type_config->getSiteResolver()) {
return $build;
}

$sites = $next_entity_type_config->getSiteResolver()->getSitesForEntity($entity);
$sites = $next_entity_type_config->getSiteResolver()->getSitesForEntity($entity) ?? [];
if (!count($sites)) {
return $build;
}
Expand Down

0 comments on commit 0720433

Please sign in to comment.