diff --git a/src/PHPCensor/Application.php b/src/PHPCensor/Application.php index c338c227..a469be95 100644 --- a/src/PHPCensor/Application.php +++ b/src/PHPCensor/Application.php @@ -104,7 +104,7 @@ class Application extends b8\Application $this->response->setContent($view->render()); } - if ($this->response->hasLayout() && $this->controller->layout) { + if ($this->response->hasLayout() && $this->controller && $this->controller->layout) { $this->setLayoutVariables($this->controller->layout); $this->controller->layout->content = $this->response->getContent();