fix bug 657696, crash in nsMsgThread::GetRootHdr, r+a=standard8
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 13 Jul 2011 20:04:48 -0700
changeset 8294 a0b96b0f6a6f19698aa8bc1beba44a47de7d170b
parent 8293 d7e23e1082cb8c9e1ac8d85bdaf0cf0738b11e9e
child 8295 d163c3c13f846a6daee06f6d339a714e36f258b8
push idunknown
push userunknown
push dateunknown
bugs657696
fix bug 657696, crash in nsMsgThread::GetRootHdr, r+a=standard8
mailnews/db/msgdb/src/nsMsgThread.cpp
--- a/mailnews/db/msgdb/src/nsMsgThread.cpp
+++ b/mailnews/db/msgdb/src/nsMsgThread.cpp
@@ -983,16 +983,18 @@ NS_IMETHODIMP nsMsgThread::GetRootHdr(PR
   {
     // if we can't get the thread root key, we'll just get the first hdr.
     // there's a bug where sometimes we weren't resetting the thread root key
     // when removing the thread root key.
     if (resultIndex)
       *resultIndex = 0;
     rv = GetChildHdrAt(0, result);
   }
+  if (!*result)
+    return rv;
   // Check that the thread id of the message is this thread.
   nsMsgKey threadId = nsMsgKey_None;
   (void)(*result)->GetThreadId(&threadId);
   if (threadId != m_threadKey)
     (*result)->SetThreadId(m_threadKey);
   return rv;
 }