BUGFIX: Make ModelAsController 404 result more testable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@54635 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-05-15 08:44:37 +00:00
parent ada3a51b4d
commit 98bee3e50f

View File

@ -19,7 +19,11 @@ class ModelAsController extends Controller implements NestedController {
$this->init();
$nested = $this->getNestedController();
$result = $nested->run($requestParams);
if(is_object($nested)) {
$result = $nested->run($requestParams);
} else {
$result = $nested;
}
$this->popCurrent();
return $result;
@ -61,7 +65,7 @@ class ModelAsController extends Controller implements NestedController {
return $controller;
} else {
die("The requested page couldn't be found.");
return "The requested page couldn't be found.";
}
} else {