refactor: add error handling for missing theme directory in ThemeHelper.php

This commit is contained in:
Zack Spear
2025-04-07 15:42:00 -07:00
parent 101644b46b
commit ee489bfe5f

View File

@@ -135,7 +135,13 @@ class ThemeHelper {
*/
public static function getThemesFromFileSystem(string $docroot): array {
$themes = [];
$themeFiles = glob("$docroot/webGui/styles/themes/*.css");
$themePath = "$docroot/webGui/styles/themes";
if (!is_dir($themePath)) {
error_log("Theme directory not found: $themePath");
return $themes;
}
$themeFiles = glob("$themePath/*.css");
foreach ($themeFiles as $themeFile) {
$themeName = basename($themeFile, '.css');