Merge pull request #3102 from ss23/patch-3

MINOR LeftAndMain::getRecord check $ClassName before use
This commit is contained in:
Simon Welsh 2014-05-05 17:47:57 +10:00
commit ddae5825b3

View File

@ -627,9 +627,9 @@ class LeftAndMain extends Controller implements PermissionProvider {
$className = $this->stat('tree_class'); $className = $this->stat('tree_class');
if($className && $id instanceof $className) { if($className && $id instanceof $className) {
return $id; return $id;
} else if($id == 'root') { } else if($className && $id == 'root') {
return singleton($className); return singleton($className);
} else if(is_numeric($id)) { } else if($className && is_numeric($id)) {
return DataObject::get_by_id($className, $id); return DataObject::get_by_id($className, $id);
} else { } else {
return false; return false;