Do not call the layout's onInit() method if there is no layout.

This commit is contained in:
alekseybobkov 2014-07-09 00:11:59 +11:00
parent 6db0faa240
commit 9c4567fc0b
1 changed files with 5 additions and 3 deletions

View File

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