diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 069ed1860..9eb5b0111 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -151,12 +151,14 @@ class ExceptionRenderer { $response->header($exception->responseHeader()); } - try { - $controller = new CakeErrorController($request, $response); - $controller->startupProcess(); - } catch (Exception $e) { - if (!empty($controller) && $controller->Components->enabled('RequestHandler')) { - $controller->RequestHandler->startup($controller); + if (class_exists('AppController')) { + try { + $controller = new CakeErrorController($request, $response); + $controller->startupProcess(); + } catch (Exception $e) { + if (!empty($controller) && $controller->Components->enabled('RequestHandler')) { + $controller->RequestHandler->startup($controller); + } } } if (empty($controller)) {