diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index bd1a2d6cd9..2500cc49b3 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -221,6 +221,9 @@ protected function getSiteNodeForLoggedInUser(): ?NodeInterface protected function findNodeToEdit(): ?NodeInterface { $siteNode = $this->getSiteNodeForLoggedInUser(); + if (!$siteNode) { + throw new \RuntimeException('Could not find site node for current user.', 1697707361); + } $reflectionMethod = new \ReflectionMethod($this->backendRedirectionService, 'getLastVisitedNode'); $reflectionMethod->setAccessible(true); $node = $reflectionMethod->invoke($this->backendRedirectionService, $siteNode->getContext()->getWorkspaceName());