Bug 756971 - Null check for the return values of nsIMsgHeaderParser.parseHeadersWithArray (SM fix). r+sr=mnyromyr
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 18 Jun 2012 18:46:47 -0400
changeset 10461 59d9b916d310ee83a37a8e10f41942af0fe28c38
parent 10460 307193116eff79f395125562f6a6404898b12b2c
child 10462 47380a5f11f4a7bd2dcb857f35187b42d374eea8
push id7912
push userryanvm@gmail.com
push dateMon, 18 Jun 2012 22:49:17 +0000
treeherdercomm-central@47380a5f11f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs756971
Bug 756971 - Null check for the return values of nsIMsgHeaderParser.parseHeadersWithArray (SM fix). r+sr=mnyromyr
suite/mailnews/addrbook/abSelectAddressesDialog.js
suite/mailnews/compose/MsgComposeCommands.js
--- a/suite/mailnews/addrbook/abSelectAddressesDialog.js
+++ b/suite/mailnews/addrbook/abSelectAddressesDialog.js
@@ -215,17 +215,17 @@ function AddCardIntoBucket(prefix, card)
     }
   else {
     AddAddressIntoBucket(prefix, address, card.primaryEmail);
   }
 }
 
 function AddAddressIntoBucket(prefix, address, email)
 {
-  if (email == "")
+  if (!email)
   {
     Services.prompt.alert(window,
                           gAddressBookBundle.getString("emptyEmailAddCardTitle"),
                           gAddressBookBundle.getString("emptyEmailAddCard"));
   }
   else
   {
     var body = document.getElementById("bucketBody");
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -2064,16 +2064,18 @@ function addRecipientsToIgnoreList(aAddr
     var fullNames = {};
     var numAddresses = hdrParser.parseHeadersWithArray(aAddressesToAdd, emailAddresses, names, fullNames);
     var tokenizedNames = [];
 
     // each name could consist of multiple words delimited by commas and/or spaces.
     // i.e. Green Lantern or Lantern,Green.
     for (let i = 0; i < names.value.length; i++)
     {
+      if (!names.value[i])
+        continue;
       var splitNames = names.value[i].match(/[^\s,]+/g);
       if (splitNames)
         tokenizedNames = tokenizedNames.concat(splitNames);
     }
 
     InlineSpellCheckerUI.mInlineSpellChecker.ignoreWords(tokenizedNames, tokenizedNames.length);
   }
 }