diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index cb8117fd3..fb7eb6e11 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -177,9 +177,11 @@ class Controller extends BaseController * Give the layout and page an opportunity to participate * after components are initialized and before AJAX is handled. */ - CmsException::mask($this->layout, 300); - $this->layoutObj->onInit(); - CmsException::unmask(); + if ($this->layoutObj) { + CmsException::mask($this->layout, 300); + $this->layoutObj->onInit(); + CmsException::unmask(); + } CmsException::mask($this->page, 300); $this->pageObj->onInit();