Handle undefined theme the right way

Sorry for the confusion.
This is the right way to do #10236.
This was actually already fixed in #10236, but this PR fixes an edgy case where `currentTheme` got `undefined` after changing from a addModeClass-theme to the default theme.