Bug 756971 - Null check for the return values of nsIMsgHeaderParser.parseHeadersWithArray (SM fix). r+sr=mnyromyr a=Callek via irc.
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 18 Jun 2012 18:46:47 -0400
changeset 12435 d269e7c0fb803dee8095676659dbc3e5fc49b10d
parent 12434 dae879e8e4eedbbb3d06612eaca53e83156fb43e
child 12436 3135d932747c16787d8ddb1b43f44780f8e8c9c1
push id599
push usermconley@mozilla.com
push dateMon, 16 Jul 2012 20:33:12 +0000
treeherdercomm-beta@c3489d5b7b65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs756971
Bug 756971 - Null check for the return values of nsIMsgHeaderParser.parseHeadersWithArray (SM fix). r+sr=mnyromyr a=Callek via irc.
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
@@ -2063,16 +2063,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);
   }
 }