MINOR Allowing NULL returns from getRecord() in LeftAndMain->getSiteTreeFor()

This commit is contained in:
Ingo Schommer 2011-04-22 17:42:40 +12:00
parent 51c02289da
commit be68450ce1
1 changed files with 2 additions and 1 deletions

View File

@ -485,7 +485,8 @@ class LeftAndMain extends Controller {
if (!$numChildrenMethod) $numChildrenMethod = 'numChildren';
// Get the tree root
$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
$record = ($rootID) ? $this->getRecord($rootID) : null;
$obj = $record ? $record : singleton($className);
// Mark the nodes of the tree to return
if ($filterFunction) $obj->setMarkingFilterFunction($filterFunction);