js/main: Throw error if no valid default stylesheet is found

Throw an error using an informative message in case a mode uses a stylesheet
that can't be loaded, instead of crashing later because the theming can't be
properly computed, and thus the minimum size of the actors.


(cherry picked from commit 30cb2127a1)
This commit is contained in:
Marco Trevisan (Treviño) 2018-08-15 01:33:13 +00:00 committed by Marco Trevisan
parent e027af9548
commit 5ae5811155

View File

@ -343,6 +343,9 @@ function loadTheme() {
let theme = new St.Theme ({ application_stylesheet: _cssStylesheet, let theme = new St.Theme ({ application_stylesheet: _cssStylesheet,
default_stylesheet: _defaultCssStylesheet }); default_stylesheet: _defaultCssStylesheet });
if (theme.default_stylesheet == null)
throw new Error("No valid stylesheet found for '%s'".format(sessionMode.stylesheetName));
if (previousTheme) { if (previousTheme) {
let customStylesheets = previousTheme.get_custom_stylesheets(); let customStylesheets = previousTheme.get_custom_stylesheets();