diff --git a/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php b/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php index 6d00cc314ae..9f5e7b9a4ff 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php +++ b/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php @@ -81,14 +81,15 @@ public function findSiteNodeBySite( ); if (!$siteNode) { - throw new \RuntimeException(sprintf( - 'No site node found for site "%s"', $site->getNodeName() - ), 1697140379); + throw new \RuntimeException(sprintf('No site node found for site "%s"', $site->getNodeName()), 1697140379); } if (!$this->getNodeType($siteNode)->isOfType(NodeTypeNameFactory::NAME_SITE)) { throw new \RuntimeException(sprintf( - 'The site node "%s" (type: "%s") must be of type "%s"', $siteNode->nodeAggregateId->value, $siteNode->nodeTypeName->value, NodeTypeNameFactory::NAME_SITE + 'The site node "%s" (type: "%s") must be of type "%s"', + $siteNode->nodeAggregateId->value, + $siteNode->nodeTypeName->value, + NodeTypeNameFactory::NAME_SITE ), 1697140367); } diff --git a/Neos.Neos/Classes/View/FusionExceptionView.php b/Neos.Neos/Classes/View/FusionExceptionView.php index 414c5fd80dc..4406031ca8c 100644 --- a/Neos.Neos/Classes/View/FusionExceptionView.php +++ b/Neos.Neos/Classes/View/FusionExceptionView.php @@ -118,9 +118,8 @@ public function render() $liveWorkspace = $contentRepository->getWorkspaceFinder()->findOneByName(WorkspaceName::forLive()); $currentSiteNode = null; - if ($liveWorkspace) { - $site = $this->siteRepository->findOneByNodeName($siteDetectionResult->siteNodeName); - + $site = $this->siteRepository->findOneByNodeName($siteDetectionResult->siteNodeName); + if ($liveWorkspace && $site) { $currentSiteNode = $this->siteNodeUtility->findSiteNodeBySite( $site, $liveWorkspace->currentContentStreamId,