changeset 6:e02de6b2566e

Ensure that data.messages is set before checking its length
author Franck Deroche <franck@defr.org>
date Fri, 31 Dec 2010 14:07:33 +0100
parents be7efc2a145e
children 85e281a44a62
files popups.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/popups.js	Fri Dec 31 14:05:43 2010 +0100
+++ b/popups.js	Fri Dec 31 14:07:33 2010 +0100
@@ -978,7 +978,7 @@
       // Show messages in dialog and embed the results in the original page.
       // TODO - should seperate these two functions.
 //      var showMessage = data.messages.length && !popup.options.noMessage;
-      if (data.messages.length) {
+      if (data.messages && data.messages.length) {
         // If we just dismissed the last popup dialog.
         if (!Popups.activePopup() && !popup.options.noMessage) {
           // Show drupal_set_message in message popup.