Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.255.2.35
diff -u -p -r1.255.2.35 menu.inc
--- includes/menu.inc	6 Sep 2010 11:01:29 -0000	1.255.2.35
+++ includes/menu.inc	14 Oct 2010 00:35:40 -0000
@@ -1556,29 +1556,31 @@ function menu_set_active_trail($new_trai
       }
     }
 
-    $tree = menu_tree_page_data(menu_get_active_menu_name());
-    list($key, $curr) = each($tree);
-
-    while ($curr) {
-      // Terminate the loop when we find the current path in the active trail.
-      if ($curr['link']['href'] == $item['href']) {
-        $trail[] = $curr['link'];
-        $curr = FALSE;
-      }
-      else {
-        // Add the link if it's in the active trail, then move to the link below.
-        if ($curr['link']['in_active_trail']) {
+    if ($item) {
+      $tree = menu_tree_page_data(menu_get_active_menu_name());
+      list($key, $curr) = each($tree);
+
+      while ($curr) {
+        // Terminate the loop when we find the current path in the active trail.
+        if ($curr['link']['href'] == $item['href']) {
           $trail[] = $curr['link'];
-          $tree = $curr['below'] ? $curr['below'] : array();
+          $curr = FALSE;
+        }
+        else {
+          // Add the link if it's in the active trail, then move to the link below.
+          if ($curr['link']['in_active_trail']) {
+            $trail[] = $curr['link'];
+            $tree = $curr['below'] ? $curr['below'] : array();
+          }
+          list($key, $curr) = each($tree);
         }
-        list($key, $curr) = each($tree);
       }
-    }
-    // Make sure the current page is in the trail (needed for the page title),
-    // but exclude tabs and the front page.
-    $last = count($trail) - 1;
-    if ($trail[$last]['href'] != $item['href'] && !(bool)($item['type'] & MENU_IS_LOCAL_TASK) && !drupal_is_front_page()) {
-      $trail[] = $item;
+      // Make sure the current page is in the trail (needed for the page title),
+      // but exclude tabs and the front page.
+      $last = count($trail) - 1;
+      if ($trail[$last]['href'] != $item['href'] && !(bool)($item['type'] & MENU_IS_LOCAL_TASK) && !drupal_is_front_page()) {
+        $trail[] = $item;
+      }
     }
   }
   return $trail;
