Bug 64267 - clicking on email address/mailto link in message body doesn't set the correct From (identity) - bustage fix for .emls; r=bienvenu
authorJim Porter <squibblyflabbetydoo@gmail.com>
Wed, 06 Jul 2011 20:08:05 -0500
changeset 8518 a6bdbe78f1f75d4199f303e13af6cbb0bc9f1034
parent 8517 cc06bf5d9186e3c5664a212f69a685a344b4307e
child 8519 8961a80e383c2b133bb6e6f3c9f4bf6f127cec8e
child 8525 31cb62010d42c2338eebe3d894382d122333853f
push id158
push userbugzilla@standard8.plus.com
push dateTue, 27 Sep 2011 19:18:14 +0000
treeherdercomm-beta@e47b99c61e4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbienvenu
bugs64267
Bug 64267 - clicking on email address/mailto link in message body doesn't set the correct From (identity) - bustage fix for .emls; r=bienvenu
mailnews/compose/src/nsMsgComposeContentHandler.cpp
--- a/mailnews/compose/src/nsMsgComposeContentHandler.cpp
+++ b/mailnews/compose/src/nsMsgComposeContentHandler.cpp
@@ -98,16 +98,21 @@ nsresult nsMsgComposeContentHandler::Get
   nsCOMPtr<nsIMsgDBHdr> msgHdr;
   rv = msgURI->GetMessageHeader(getter_AddRefs(msgHdr));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgFolder> folder;
   rv = msgHdr->GetFolder(getter_AddRefs(folder));
   NS_ENSURE_SUCCESS(rv, rv);
 
+  // nsIMsgDBHdrs from .eml messages have a null folder, so bail out if that's
+  // the case.
+  if (!folder)
+    return NS_ERROR_FAILURE;
+
   nsCOMPtr<nsIMsgIncomingServer> server;
   rv = folder->GetServer(getter_AddRefs(server));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgAccountManager> accountManager = do_GetService(
     NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);