Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.252.2.3
diff -u -r1.252.2.3 update.php
--- update.php	30 Mar 2009 11:15:11 -0000	1.252.2.3
+++ update.php	11 Jul 2009 10:35:31 -0000
@@ -307,12 +307,18 @@
     $log_message = ' All errors have been logged.';
   }
 
-  if ($_SESSION['update_success']) {
+  if (isset($_SESSION['update_success'])) {
     $output = '<p>Updates were attempted. If you see no failures below, you may proceed happily to the <a href="'. base_path() .'?q=admin">administration pages</a>. Otherwise, you may need to update your database manually.'. $log_message .'</p>';
   }
   else {
-    list($module, $version) = array_pop(reset($_SESSION['updates_remaining']));
-    $output = '<p class="error">The update process was aborted prematurely while running <strong>update #'. $version .' in '. $module .'.module</strong>.'. $log_message;
+    $remaining = isset($_SESSION['updates_remaining']) ? $_SESSION['updates_remaining'] : NULL;
+    if(isset($remaining) && count($remaining)){
+      list($module, $version) = array_pop(reset($remaining));
+      $output = '<p class="error">The update process was aborted prematurely while running <strong>update #'. $version .' in '. $module .'.module</strong>.'. $log_message;
+    }
+    else{
+      $output = '<p class="error">You tried to run the update process without having any updates to run, or you accessed this page without running the rest of the process. Run the update process again if you are sure there are updates to be run.</p>';
+    }
     if (module_exists('dblog')) {
       $output .= ' You may need to check the <code>watchdog</code> database table manually.';
     }
