summaryrefslogtreecommitdiff
path: root/includes/bootstrap.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r--includes/bootstrap.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 0728aaf8c..0be9f92fa 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -637,8 +637,9 @@ function drupal_set_message($message = NULL, $type = 'status') {
* As a side effect, this function clears the message queue.
*/
function drupal_get_messages() {
- $messages = drupal_set_message();
- unset($_SESSION['messages']);
+ if ($messages = drupal_set_message()) {
+ unset($_SESSION['messages']);
+ }
return $messages;
}