Bug 726655 - Add null check in nsMsgDBView::GetThreadContainingMsgHdr() to avoid crash. r=alta88 DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sun, 29 Sep 2019 10:25:14 +0200
changeset 37013 dd116f5f342a890a69212169f4008600b2529749
parent 37012 6881607913e56d63be56ec69fa934103d0bfbf75
child 37014 03fd56087c3ab9fc21ae770b7a82bbaf7491b882
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersalta88
bugs726655
Bug 726655 - Add null check in nsMsgDBView::GetThreadContainingMsgHdr() to avoid crash. r=alta88 DONTBUILD
mailnews/base/src/nsMsgDBView.cpp
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -4943,16 +4943,17 @@ nsresult nsMsgDBView::ExpandAll() {
 
   SelectionChangedXPCOM();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBView::GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr,
                                        nsIMsgThread **pThread) {
+  if (!m_db) return NS_ERROR_FAILURE;
   return m_db->GetThreadContainingMsgHdr(msgHdr, pThread);
 }
 
 nsresult nsMsgDBView::ExpandByIndex(nsMsgViewIndex index,
                                     uint32_t *pNumExpanded) {
   if ((uint32_t)index >= m_keys.Length()) return NS_MSG_MESSAGE_NOT_FOUND;
 
   uint32_t flags = m_flags[index];