Bug 529429 - crash [@ morkTable::CutRow(nsIMdbEnv*, nsIMdbRow*)]. r=dbienvenu,a=Standard8
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 08 Aug 2011 10:05:06 +0900
changeset 8371 a166416526d2dfeab16b40918e409f2f26f2946d
parent 8370 f0dd4c316c5a24b47f87286cacac212c3d421542
child 8372 9ef10c2815edbd84f226af283f1edffc81214aa1
push idunknown
push userunknown
push dateunknown
reviewersdbienvenu, Standard8
bugs529429
Bug 529429 - crash [@ morkTable::CutRow(nsIMdbEnv*, nsIMdbRow*)]. r=dbienvenu,a=Standard8
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -1994,18 +1994,21 @@ nsresult nsMsgDatabase::RemoveHeaderFrom
   if (!msgHdr)
     return NS_ERROR_NULL_POINTER;
   nsresult ret = NS_OK;
 
   RemoveHdrFromCache(msgHdr, nsMsgKey_None);
   if (UseCorrectThreading())
     RemoveMsgRefsFromHash(msgHdr);
   nsIMdbRow* row = msgHdr->GetMDBRow();
-  ret = m_mdbAllMsgHeadersTable->CutRow(GetEnv(), row);
-  row->CutAllColumns(GetEnv());
+  if (row)
+  {
+    ret = m_mdbAllMsgHeadersTable->CutRow(GetEnv(), row);
+    row->CutAllColumns(GetEnv());
+  }
   msgHdr->m_initedValues = 0; // invalidate cached values.
   return ret;
 }
 
 nsresult nsMsgDatabase::IsRead(nsMsgKey key, PRBool *pRead)
 {
   nsCOMPtr <nsIMsgDBHdr> msgHdr;