=== modified file 'modules/shortcut/shortcut.module'
--- modules/shortcut/shortcut.module	2010-06-30 15:12:59 +0000
+++ modules/shortcut/shortcut.module	2010-07-12 01:36:46 +0000
@@ -631,7 +631,7 @@ function shortcut_renderable_links($shor
   if (!isset($shortcut_set)) {
     $shortcut_set = shortcut_current_displayed_set();
   }
-  return menu_tree($shortcut_set->set_name);
+  return $shortcut_set ? menu_tree($shortcut_set->set_name) : array();
 }
 
 /**
@@ -652,36 +652,38 @@ function shortcut_preprocess_page(&$vari
 
     $shortcut_set = shortcut_current_displayed_set();
 
-    // Check if $link is already a shortcut and set $link_mode accordingly.
-    foreach ($shortcut_set->links as $shortcut) {
-      if ($link == $shortcut['link_path']) {
-        $mlid = $shortcut['mlid'];
-        break;
+    if ($shortcut_set) {
+      // Check if $link is already a shortcut and set $link_mode accordingly.
+      foreach ($shortcut_set->links as $shortcut) {
+        if ($link == $shortcut['link_path']) {
+          $mlid = $shortcut['mlid'];
+          break;
+        }
       }
-    }
-    $link_mode = isset($mlid) ? "remove" : "add";
+      $link_mode = isset($mlid) ? "remove" : "add";
 
-    if ($link_mode == "add") {
-      $query['token'] = drupal_get_token('shortcut-add-link');
-      $link_text = shortcut_set_switch_access() ? t('Add to %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Add to shortcuts');
-      $link_path = 'admin/config/user-interface/shortcut/' . $shortcut_set->set_name . '/add-link-inline';
-    }
-    else {
-      $query['mlid'] = $mlid;
-      $link_text = shortcut_set_switch_access() ? t('Remove from %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Remove from shortcuts');
-      $link_path = 'admin/config/user-interface/shortcut/link/' . $mlid . '/delete';
-    }
+      if ($link_mode == "add") {
+        $query['token'] = drupal_get_token('shortcut-add-link');
+        $link_text = shortcut_set_switch_access() ? t('Add to %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Add to shortcuts');
+        $link_path = 'admin/config/user-interface/shortcut/' . $shortcut_set->set_name . '/add-link-inline';
+      }
+      else {
+        $query['mlid'] = $mlid;
+        $link_text = shortcut_set_switch_access() ? t('Remove from %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Remove from shortcuts');
+        $link_path = 'admin/config/user-interface/shortcut/link/' . $mlid . '/delete';
+      }
 
-    if (theme_get_setting('shortcut_module_link')) {
-      $variables['title_suffix']['add_or_remove_shortcut'] = array(
-        '#attached' => array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')),
-        '#prefix' => '<div class="add-or-remove-shortcuts ' . $link_mode . '-shortcut">',
-        '#type' => 'link',
-        '#title' => '<span class="icon"></span><span class="text">' . $link_text . '</span>',
-        '#href' => $link_path,
-        '#options' => array('query' => $query, 'html' => TRUE),
-        '#suffix' => '</div>',
-      );
+      if (theme_get_setting('shortcut_module_link')) {
+        $variables['title_suffix']['add_or_remove_shortcut'] = array(
+          '#attached' => array('css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.css')),
+          '#prefix' => '<div class="add-or-remove-shortcuts ' . $link_mode . '-shortcut">',
+          '#type' => 'link',
+          '#title' => '<span class="icon"></span><span class="text">' . $link_text . '</span>',
+          '#href' => $link_path,
+          '#options' => array('query' => $query, 'html' => TRUE),
+          '#suffix' => '</div>',
+        );
+      }
     }
   }
 }
@@ -707,7 +709,7 @@ function shortcut_toolbar_pre_render($to
   $links['#suffix'] = '</div>';
   $shortcut_set = shortcut_current_displayed_set();
   $configure_link = NULL;
-  if (shortcut_set_edit_access($shortcut_set)) {
+  if ($shortcut_set && shortcut_set_edit_access($shortcut_set)) {
     $configure_link = array(
       '#type' => 'link',
       '#title' => t('Edit shortcuts'),

