Skip to content

Commit

Permalink
Merge pull request #3643 from neos/bugfix/3182-betterErrorForGetConte…
Browse files Browse the repository at this point in the history
…xtOnNull

BUGFIX: #3182 betterErrorForGetContextOnNull
  • Loading branch information
jonnitto authored Nov 4, 2023
2 parents 3b89b9a + d7b2d33 commit 74f88b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 74f88b3

Please sign in to comment.