? files
? sites/localhost
? sites/all/modules
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.151
diff -u -F^f -r1.151 bootstrap.inc
--- includes/bootstrap.inc	28 Mar 2007 14:08:21 -0000	1.151
+++ includes/bootstrap.inc	3 Apr 2007 14:17:14 -0000
@@ -709,6 +709,11 @@ function drupal_set_message($message = N
  *   (optional) Only return messages of this type.
  * @param $clear_queue
  *   (optional) Set to FALSE if you do not want to clear the messages queue
+ * @return
+ *   An associative array, the key is the message type, the value an array
+ *   of messages. If the $type parameter is passed, you get only that type,
+ *   or an empty array if there are no such messages. If $type is not passed,
+ *   all message types are returned, or an empty array if none exist.
  */
 function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
   if ($messages = drupal_set_message()) {
@@ -716,7 +721,7 @@ function drupal_get_messages($type = NUL
       if ($clear_queue) {
          unset($_SESSION['messages'][$type]);
       }
-      return array($type => $messages[$type]);
+      return isset($messages[$type]) ? array($type => $messages[$type]) : array();
     }
     else {
       if ($clear_queue) {
