From 31efd99cee3807df11948dc31110fed4c513d54f Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 5 Mar 2011 23:58:05 +0000 Subject: added a catch to menu builder for bad menu items git-svn-id: http://code.elgg.org/elgg/trunk@8605 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggMenuBuilder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php index bafed2cea..dcf147d19 100644 --- a/engine/classes/ElggMenuBuilder.php +++ b/engine/classes/ElggMenuBuilder.php @@ -66,7 +66,10 @@ class ElggMenuBuilder { // get menu items for this context $selected_menu = array(); foreach ($this->menu as $menu_item) { - //var_dump($menu_item); + if (!is_object($menu_item)) { + elgg_log("A non-object was passed to ElggMenuBuilder", "ERROR"); + continue; + } if ($menu_item->inContext()) { $selected_menu[] = $menu_item; } -- cgit v1.2.3