From fd4ab2babce7e981ddd698987fda5cf625daf2e8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 2 Nov 2021 15:09:52 +0100 Subject: [PATCH] StyleSheet: Handle missing themes gracefully --- library/Icinga/Web/StyleSheet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 0c4900f7d..94e01ad13 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -181,8 +181,8 @@ class StyleSheet $mode = 'none'; if ($user = Auth::getInstance()->getUser()) { - $file = $themePath !== null ? file_get_contents($themePath) : ''; - if ($file !== '' && ! preg_match(self::REGEX_ALL_MODE_QUERY, $file)) { + $file = $themePath !== null ? @file_get_contents($themePath) : ''; + if ($file && $file !== '' && ! preg_match(self::REGEX_ALL_MODE_QUERY, $file)) { if (preg_match(self::REGEX_AUTO_MODE_QUERY, $file)) { $mode = 'system'; }