neos-ui icon indicating copy to clipboard operation
neos-ui copied to clipboard

Better Errors: Call to a member function getContext() on null

Open mhsdesign opened this issue 3 years ago • 0 comments

Description

Steps to Reproduce

  1. you have no site, fx. after `flow site:prune '*'" or before importing a site
  2. you open the backend by typing /neos

Expected behavior

Somebody tells you that there is not much to manage in neos but the backend works (the other modules), or you get a exception which states exacly on first glance what is actually wrong.

Actual behavior

You get a "nice" error:

image

Call to a member function getContext() on null

[What actually happened]

The BackendController calls at some point inside findNodeToEdit $siteNode->getContext() ... on null. $siteNode was retrieved by the internal method getSiteNodeForLoggedInUser which cant (for apparent reasons) find out the site node. This results in a rather harsh error and should be avoided to calm the user ;)

Affected Versions

Neos.UI: since at least 7.3 but sure before ... tested with 8.0

mhsdesign avatar Sep 02 '22 21:09 mhsdesign