Bug 919247 - crash in nsMsgDBView::SetThreadIgnored(nsIMsgThread*, unsigned int, bool). r+a=standard8
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -6965,28 +6965,32 @@ nsresult nsMsgDBView::SetThreadIgnored(n
NoteChange(threadIndex, 1, nsMsgViewNotificationCode::changed);
if (ignored)
{
nsTArray<nsMsgKey> idsMarkedRead;
MarkThreadRead(thread, threadIndex, idsMarkedRead, true);
CollapseByIndex(threadIndex, nullptr);
}
+
+ if (!m_db)
+ return NS_ERROR_FAILURE;
return m_db->MarkThreadIgnored(thread, m_keys[threadIndex], ignored, this);
}
nsresult nsMsgDBView::SetSubthreadKilled(nsIMsgDBHdr *header, nsMsgViewIndex msgIndex, bool ignored)
{
if (!IsValidIndex(msgIndex))
return NS_MSG_INVALID_DBVIEW_INDEX;
NoteChange(msgIndex, 1, nsMsgViewNotificationCode::changed);
- nsresult rv;
-
- rv = m_db->MarkHeaderKilled(header, ignored, this);
+
+ if (!m_db)
+ return NS_ERROR_FAILURE;
+ nsresult rv = m_db->MarkHeaderKilled(header, ignored, this);
NS_ENSURE_SUCCESS(rv, rv);
if (ignored)
{
nsCOMPtr <nsIMsgThread> thread;
nsresult rv;
rv = GetThreadContainingMsgHdr(header, getter_AddRefs(thread));
if (NS_FAILED(rv))