Bug 1506613 - Check parser_>m_db for null in MaildirStoreParser::TimerCallback to avoid crash. r=mkmelin
authoraceman <acelists@atlas.sk>
Sun, 26 May 2019 00:46:31 +0200
changeset 35690 0820221247ce8a27975477e3ad43dede079dd9c2
parent 35689 a37b55df5e0baa88da4816cfd4f3ca96b6633f79
child 35691 13000cbf0633b3a34248cf310de2c4201388aa0d
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1506613
Bug 1506613 - Check parser_>m_db for null in MaildirStoreParser::TimerCallback to avoid crash. r=mkmelin
mailnews/local/src/nsMsgMaildirStore.cpp
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -1220,18 +1220,18 @@ nsresult MaildirStoreParser::ParseNextMe
 void MaildirStoreParser::TimerCallback(nsITimer *aTimer, void *aClosure) {
   MaildirStoreParser *parser = (MaildirStoreParser *)aClosure;
   bool hasMore;
   parser->m_directoryEnumerator->HasMoreElements(&hasMore);
   if (!hasMore) {
     nsCOMPtr<nsIMsgPluggableStore> store;
     parser->m_folder->GetMsgStore(getter_AddRefs(store));
     parser->m_timer->Cancel();
-    parser->m_db->SetSummaryValid(true);
-    //    store->SetSummaryFileValid(parser->m_folder, parser->m_db, true);
+    if (parser->m_db) parser->m_db->SetSummaryValid(true);
+    // store->SetSummaryFileValid(parser->m_folder, parser->m_db, true);
     if (parser->m_listener) {
       nsresult rv;
       nsCOMPtr<nsIMailboxUrl> mailboxurl =
           do_CreateInstance(NS_MAILBOXURL_CONTRACTID, &rv);
       if (NS_SUCCEEDED(rv) && mailboxurl) {
         nsCOMPtr<nsIMsgMailNewsUrl> url = do_QueryInterface(mailboxurl);
         url->SetUpdatingFolder(true);
         nsAutoCString uriSpec("mailbox://");