diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 90828ae52..94017b350 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -93,6 +93,9 @@ class Controller extends BaseController public function __construct($theme = null) { $this->theme = $theme ? $theme : Theme::getActiveTheme(); + if (!$this->theme) + throw new CmsException(Lang::get('cms::lang.theme.active.not_found')); + $this->assetPath = Config::get('cms.themesDir').'/'.$this->theme->getDirName(); $this->router = new Router($this->theme); $this->initTwigEnvironment(); diff --git a/modules/cms/lang/en/lang.php b/modules/cms/lang/en/lang.php index 661443dc6..e83c70331 100644 --- a/modules/cms/lang/en/lang.php +++ b/modules/cms/lang/en/lang.php @@ -15,6 +15,7 @@ return [ 'theme' => [ 'active' => [ 'not_set' => "The active theme is not set.", + 'not_found' => "The active theme is not found.", ], 'edit' => [ 'not_set' => "The edit theme is not set.",