StyleSheet: Handle missing themes gracefully

This commit is contained in:
Johannes Meyer 2021-11-02 15:09:52 +01:00
parent aa101e18c8
commit fd4ab2babc
1 changed files with 2 additions and 2 deletions

View File

@ -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';
}