浏览代码

Fallback to the default theme

if the configured one doesn't exist, fallback to "Default"
Belle Aerni 2 年之前
父节点
当前提交
d6588573b0
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/AntCMS/AntCMS.php

+ 5 - 0
src/AntCMS/AntCMS.php

@@ -98,6 +98,11 @@ class AntCMS
     {
         $currentConfig = AntConfig::currentConfig();
         $theme = $theme ?? $currentConfig['activeTheme'];
+
+        if (!is_dir(antThemePath . '/' . $theme)) {
+            $theme = 'Default';
+        }
+
         $templatePath = antThemePath . '/' . $theme . '/' . 'Templates';
         $defaultTemplates = antThemePath . '/Default/Templates';