Permalink
Browse files

Prevents notice error when parent page isn't set

  • Loading branch information...
Matt Gunn
Matt Gunn committed Mar 24, 2012
1 parent ecee3cc commit 4e9cbe07718544b6996f1ce69a7c10124d75c3da
Showing with 3 additions and 1 deletion.
  1. +3 −1 code/controllers/CMSMain.php
@@ -264,7 +264,9 @@ public function SiteTreeHints() {
$def[$class]['defaultChild'] = $defaultChild;
$defaultParent = $obj->defaultParent();
- $id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
+ $parent = SiteTree::get_by_link($defaultParent);
+
+ $id = $parent ? $parent->id : null;
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;

0 comments on commit 4e9cbe0

Please sign in to comment.