neos-ui
                                
                                 neos-ui copied to clipboard
                                
                                    neos-ui copied to clipboard
                            
                            
                            
                        Better Errors: Call to a member function getContext() on null
Description
Steps to Reproduce
- you have no site, fx. after `flow site:prune '*'" or before importing a site
- 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:

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