diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index e35c01ab8..3f23d273e 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -115,13 +115,18 @@ function enableExtension(uuid) { extensionOrder.push(uuid); let stylesheetNames = [global.session_mode + '.css', 'stylesheet.css']; + let theme = St.ThemeContext.get_for_stage(global.stage).get_theme(); for (let i = 0; i < stylesheetNames.length; i++) { - let stylesheetFile = extension.dir.get_child(stylesheetNames[i]); - if (stylesheetFile.query_exists(null)) { - let theme = St.ThemeContext.get_for_stage(global.stage).get_theme(); + try { + let stylesheetFile = extension.dir.get_child(stylesheetNames[i]); theme.load_stylesheet(stylesheetFile); extension.stylesheet = stylesheetFile; break; + } catch (e) { + if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) + continue; // not an error + log(`Failed to load stylesheet for extension ${uuid}: ${e.message}`); + return; } }