Throw an error when the active theme is not found

This commit is contained in:
Sam Georges 2014-07-23 17:45:05 +10:00
parent 8b17901aee
commit 7cd80f8a59
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -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.",