From d7b2d3343d75afad80c1696428159ccc89f16f99 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:28:47 +0200 Subject: [PATCH] BUGFIX: #3182 betterErrorForGetContextOnNull --- Classes/Controller/BackendController.php | 3 +++ 1 file changed, 3 insertions(+) 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());