Merge pull request #10800 from creative-commoners/pulls/5/scan-theme-dir

FIX Ensure dir exists before scanning it
This commit is contained in:
Sabina Talipova 2023-06-08 08:37:19 +12:00 committed by GitHub
commit 86917ce291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);