fix bug 657696, crash in nsMsgThread::GetRootHdr, r+a=standard8 THUNDERBIRD_6_0b1_BUILD1 THUNDERBIRD_6_0b1_RELEASE
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 13 Jul 2011 20:04:48 -0700
changeset 7943 89a759cf4de4c4338ed748cbee9d75954c9af395
parent 7942 c48237b526a7daf6340948cf476f0c13317e9803
child 7944 e8256964968d182cbafde372f9fc099cb348a78a
child 7951 1c4a49c9cb184a6eb0f793c043163e35ec3837df
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
@@ -1017,16 +1017,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;
 }