Call to a member function getStylesheet() on null


I tried to upgrade from v9.0.0RC4 to v9.0.2 and right after I get this error message:
Call to a member function getStylesheet() on null

I have custom blocks and themes in the application directory maybe there is conflict?

I don’t know what to do, please help me I would like to have the newest version, thanks!

Ok, I just commented out the mentioned line and was able to login to dashboard.

In there I’ve selected the original Atomik theme and its looks the front office is works now The problem is every customization is in my custom theme and if I select that theme from frontoffice theme selector the following error message is comming up in the live preview window:
Call to a member function getIdentifier() on null

The custom theme is worked on the previous version(v9.0.0RC4)
This theme is heavily customized so this is what I want to use in the newest version(v9.0.2) By the way it’s a copy of the elemental theme and it’s in the application/theme folder.