fix bug 628647, crash in nsImapMailFolder::AddMoveResultPseudoKey, r=neil
authorDavid Bienvenu <bienvenu@nventure.com>
Mon, 31 Jan 2011 12:50:21 -0800
changeset 7044 be2443b832b0edf15be25ea22520f33270d57670
parent 7043 f41fcd73804f8013b275b56f6fbfc9536d1f1114
child 7045 43414817514a4d6099310558937295bb69528348
push idunknown
push userunknown
push dateunknown
reviewersneil
bugs628647
fix bug 628647, crash in nsImapMailFolder::AddMoveResultPseudoKey, r=neil
mailnews/imap/src/nsImapMailFolder.cpp
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -3906,17 +3906,18 @@ nsImapMailFolder::ReplayOfflineMoveCopy(
       mailnewsUrl->RegisterListener(folderListener);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsImapMailFolder::AddMoveResultPseudoKey(nsMsgKey aMsgKey)
 {
   nsCOMPtr<nsIMsgDBHdr> pseudoHdr;
-  mDatabase->GetMsgHdrForKey(aMsgKey, getter_AddRefs(pseudoHdr));
+  nsresult rv = mDatabase->GetMsgHdrForKey(aMsgKey, getter_AddRefs(pseudoHdr));
+  NS_ENSURE_SUCCESS(rv, rv);
   nsCString messageId;
   pseudoHdr->GetMessageId(getter_Copies(messageId));
   // err on the side of caution and ignore messages w/o messageid.
   if (messageId.IsEmpty())
     return NS_OK;
   if (!m_pseudoHdrs.IsInitialized())
     m_pseudoHdrs.Init(10);
   m_pseudoHdrs.Put(messageId, aMsgKey);