From 9c4567fc0b4a021f6304bbecd7af911e6567d642 Mon Sep 17 00:00:00 2001 From: alekseybobkov Date: Wed, 9 Jul 2014 00:11:59 +1100 Subject: [PATCH] Do not call the layout's onInit() method if there is no layout. --- modules/cms/classes/Controller.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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();