diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 23:09:17 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 23:09:17 -0500 |
commit | d80e610cd5bc6a9f6c0cc139e2f07e007fa05428 (patch) | |
tree | 427f8f8e9f8e252316a04db92f0b52b096b9025f /mailnews | |
parent | 66c5b11050b8aee2b467b896173279f3a35cdc3a (diff) | |
download | UXP-d80e610cd5bc6a9f6c0cc139e2f07e007fa05428.tar UXP-d80e610cd5bc6a9f6c0cc139e2f07e007fa05428.tar.gz UXP-d80e610cd5bc6a9f6c0cc139e2f07e007fa05428.tar.lz UXP-d80e610cd5bc6a9f6c0cc139e2f07e007fa05428.tar.xz UXP-d80e610cd5bc6a9f6c0cc139e2f07e007fa05428.zip |
Bug 906469 - fix maildir crash while parsing a folder.
Tag #1273
Diffstat (limited to 'mailnews')
-rw-r--r-- | mailnews/local/src/nsMsgMaildirStore.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mailnews/local/src/nsMsgMaildirStore.cpp b/mailnews/local/src/nsMsgMaildirStore.cpp index 993abbad5..6f3228938 100644 --- a/mailnews/local/src/nsMsgMaildirStore.cpp +++ b/mailnews/local/src/nsMsgMaildirStore.cpp @@ -1194,6 +1194,7 @@ MaildirStoreParser::~MaildirStoreParser() nsresult MaildirStoreParser::ParseNextMessage(nsIFile *aFile) { nsresult rv; + NS_ENSURE_TRUE(m_db, NS_ERROR_NULL_POINTER); nsCOMPtr<nsIInputStream> inputStream; nsCOMPtr<nsIMsgParseMailMsgState> msgParser = do_CreateInstance(NS_PARSEMAILMSGSTATE_CONTRACTID, &rv); @@ -1278,9 +1279,10 @@ void MaildirStoreParser::TimerCallback(nsITimer *aTimer, void *aClosure) parser->m_directoryEnumerator->GetNext(getter_AddRefs(aSupport)); nsresult rv; nsCOMPtr<nsIFile> currentFile(do_QueryInterface(aSupport, &rv)); - NS_ENSURE_SUCCESS_VOID(rv); - parser->ParseNextMessage(currentFile); - // ### TODO - what if this fails? + if (NS_SUCCEEDED(rv)) + rv = parser->ParseNextMessage(currentFile); + if (NS_FAILED(rv) && parser->m_listener) + parser->m_listener->OnStopRunningUrl(nullptr, NS_ERROR_FAILURE); } nsresult MaildirStoreParser::StartTimer() |