Commits

pietschy committed ebb2fd7

fixed issue where page might have redirect to fist child set but have no children.

  • Participants
  • Parent commits 2298e7f

Comments (0)

Files changed (1)

models/NavItem.php

     {
         $target_page = $page;
         while ($target_page != null && $target_page->getCollectionAttributeValue('replace_link_with_first_in_nav')) {
-            $target_page = $target_page->getFirstChild();
+            $firstChild = $target_page->getFirstChild();
+            // need to make sure the page actually has children.
+            if ($firstChild == null)
+                break;
+
+            $target_page = $firstChild;
         }
+
         return $target_page;
     }