diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php index 6ab2ade3a..df6733b34 100644 --- a/application/forms/PreferenceForm.php +++ b/application/forms/PreferenceForm.php @@ -186,6 +186,7 @@ class PreferenceForm extends Form ); } + $themeFile = StyleSheet::getThemeFile(Config::app()->get('themes', 'default')); if (! (bool) Config::app()->get('themes', 'disabled', false)) { $themes = Icinga::app()->getThemes(); if (count($themes) > 1) { @@ -212,7 +213,10 @@ class PreferenceForm extends Form if (isset($formData['theme']) && $formData['theme'] !== StyleSheet::DEFAULT_THEME) { $themeFile = StyleSheet::getThemeFile($formData['theme']); - $file = $themeFile !== null ? @file_get_contents($themeFile) : false; + } + + if ($themeFile !== null) { + $file = @file_get_contents($themeFile); if ($file && strpos($file, StyleSheet::LIGHT_MODE_IDENTIFIER) === false) { $disabled = ['', 'light', 'system']; }