Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent
authorR Kent James <rkent@caspia.com>
Wed, 01 Jul 2015 13:19:21 -0700
changeset 26237 6afc64f15c3ccc91ff576435f33fa4c1b3f24c8f
parent 26236 6cd8e8a55d5fc06912b7dbc1466a225502996ece
child 26238 9f0be9a6369df799d3d773af2ce25622c17b0c2c
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent
bugs837552
Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -3539,16 +3539,19 @@ NS_IMETHODIMP nsMsgDatabase::CopyHdrFrom
     nsMsgHdr* sourceMsgHdr = static_cast<nsMsgHdr*>(existingHdr);      // closed system, cast ok
     nsMsgHdr *destMsgHdr = nullptr;
     CreateNewHdr(key, (nsIMsgDBHdr **) &destMsgHdr);
     nsIMdbRow  *sourceRow = sourceMsgHdr->GetMDBRow();
     if (!destMsgHdr || !sourceRow)
       return NS_MSG_MESSAGE_NOT_FOUND;
 
     nsIMdbRow  *destRow = destMsgHdr->GetMDBRow();
+    if (!destRow)
+      return NS_ERROR_UNEXPECTED;
+
     err = destRow->SetRow(GetEnv(), sourceRow);
     if (NS_SUCCEEDED(err))
     {
       // we may have gotten the header from a cache - calling SetRow
       // basically invalidates any cached values, so invalidate them.
       destMsgHdr->m_initedValues = 0;
       if(addHdrToDB)
         err = AddNewHdrToDB(destMsgHdr, true);