Bug 1180360 - "Can't compose a message to a newsgroup from the header". r=mkmelin, a=rkent
authorJim Porter <squibblyflabbetydoo>
Fri, 03 Jul 2015 22:00:00 +0200
changeset 23108 b18de0981b18eaa422c8fb4d2eb0e189c329cce4
parent 23107 b378d2df070c803b0909466673e86980591c7ed2
child 23109 5f9058ce1b25d8f17e21c41203345c0a98667009
push idunknown
push userunknown
push dateunknown
reviewersmkmelin, rkent
bugs1180360
Bug 1180360 - "Can't compose a message to a newsgroup from the header". r=mkmelin, a=rkent
mail/base/content/msgHdrViewOverlay.js
--- a/mail/base/content/msgHdrViewOverlay.js
+++ b/mail/base/content/msgHdrViewOverlay.js
@@ -1588,19 +1588,21 @@ function EditContact(emailAddressNode)
 function SendMailToNode(addressNode, aEvent)
 {
   let fields = Components.classes["@mozilla.org/messengercompose/composefields;1"]
                          .createInstance(Components.interfaces.nsIMsgCompFields);
   let params = Components.classes["@mozilla.org/messengercompose/composeparams;1"]
                          .createInstance(Components.interfaces.nsIMsgComposeParams);
 
   fields.newsgroups = addressNode.getAttribute("newsgroup");
-  let addresses = MailServices.headerParser.makeFromDisplayAddress(
-    addressNode.getAttribute("fullAddress"), {});
-  fields.to = MailServices.headerParser.makeMimeHeader(addresses, 1);
+  if (addressNode.hasAttribute("fullAddress")) {
+    let addresses = MailServices.headerParser.makeFromDisplayAddress(
+      addressNode.getAttribute("fullAddress"), {});
+    fields.to = MailServices.headerParser.makeMimeHeader(addresses, 1);
+  }
 
   params.type = Components.interfaces.nsIMsgCompType.New;
 
   // If aEvent is passed, check if Shift key was pressed for composition in
   // non-default format (HTML vs. plaintext).
   params.format = (aEvent && aEvent.shiftKey) ? 
     Components.interfaces.nsIMsgCompFormat.OppositeOfDefault :
     Components.interfaces.nsIMsgCompFormat.Default;