Skip to content

Commit

Permalink
FIX Dont attempt to iterate over null in SiteTree::allowedChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jan 10, 2017
1 parent 483cda9 commit 5bba726
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/model/SiteTree.php
Expand Up @@ -2695,8 +2695,7 @@ public function allowedChildren() {
// Otherwise, the class and all its subclasses are allowed.
if(substr($candidate,0,1) == '*') {
$allowedChildren[] = substr($candidate,1);
} else {
$subclasses = ClassInfo::subclassesFor($candidate);
} elseif ($subclasses = ClassInfo::subclassesFor($candidate)) {
foreach($subclasses as $subclass) {
if ($subclass == 'SiteTree_root' || singleton($subclass) instanceof HiddenClass) {
continue;
Expand Down

0 comments on commit 5bba726

Please sign in to comment.