From 95eceb8d9e3652a5bc4c5b8f9f8fe74e87fffb0a Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 7 Jun 2023 17:35:13 +1200 Subject: [PATCH] FIX Ensure dir exists before scanning it --- src/i18n/TextCollection/i18nTextCollector.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/i18n/TextCollection/i18nTextCollector.php b/src/i18n/TextCollection/i18nTextCollector.php index d6a1adea6..3e1e6d9f7 100644 --- a/src/i18n/TextCollection/i18nTextCollector.php +++ b/src/i18n/TextCollection/i18nTextCollector.php @@ -472,8 +472,11 @@ class i18nTextCollector if (!$this->modulesAndThemes) { $modules = ModuleLoader::inst()->getManifest()->getModules(); // load themes as modules - $themes = array_diff(scandir(THEMES_PATH), ['..', '.']); - if ($themes) { + $themes = []; + if (is_dir(THEMES_PATH)) { + $themes = array_diff(scandir(THEMES_PATH), ['..', '.']); + } + if (!empty($themes)) { foreach ($themes as $theme) { if (is_dir(Path::join(THEMES_PATH, $theme))) { $modules[self::THEME_PREFIX . $theme] = new Module(Path::join(THEMES_PATH, $theme), BASE_PATH);