mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #3102 from ss23/patch-3
MINOR LeftAndMain::getRecord check $ClassName before use
This commit is contained in:
commit
ddae5825b3
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user