Don't throw an exception if currentTheme is undefined
Merge pull request #10236 from MarcelGerber/mode-class-undefined

Don't throw an exception if currentTheme is undefined