Permalink
Browse files

Adding an isset so a non-existant view isn't accessed.

Fixes #1954
  • Loading branch information...
1 parent 4d1f41d commit 36eca679feecc2f940f8cf70e712d4f59bd383b5 @markstory markstory committed Sep 1, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Cake/TestSuite/ControllerTestCase.php
@@ -229,8 +229,10 @@ protected function _testAction($url = '', $options = array()) {
$this->result = $Dispatch->dispatch($request, $Dispatch->response, $params);
$this->controller = $Dispatch->testController;
if ($options['return'] != 'result') {
- $this->vars = $this->controller->View->viewVars;
- $this->view = $this->controller->View->_viewNoLayout;
+ if (isset($this->controller->View)) {
+ $this->vars = $this->controller->View->viewVars;
+ $this->view = $this->controller->View->_viewNoLayout;
+ }
$this->contents = $this->controller->response->body();
}
$this->headers = $Dispatch->response->header();

0 comments on commit 36eca67

Please sign in to comment.