diff --git a/menu_block.module b/menu_block.module index 83cf0c9..1e7345b 100644 --- a/menu_block.module +++ b/menu_block.module @@ -301,8 +301,9 @@ function menu_tree_build($config) { // Get the default block name. $menu_names = menu_block_get_all_menus(); - menu_block_set_title(t($menu_names[$config['menu_name']])); - + if (array_key_exists($config['menu_name'], $menu_names)) { + menu_block_set_title(t($menu_names[$config['menu_name']])); + } if ($config['expanded'] || $config['parent_mlid']) { // Get the full, un-pruned tree. $tree = menu_tree_all_data($config['menu_name']); @@ -410,7 +411,9 @@ function menu_block_get_title($render_title_as_link = TRUE) { } // The tree's title is a menu item. else { - $title = array('#markup' => check_plain($menu_item['title'])); + if (array_key_exists('title', $menu_item)) { + $title = array('#markup' => check_plain($menu_item['title'])); + } } return $title; }