summaryrefslogtreecommitdiff
path: root/mailnews/local/src/nsMsgMaildirStore.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-10 23:09:17 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-11-10 23:09:17 -0500
commitfacc01c9cbbb6cf040a5334e4418129689fb9b72 (patch)
tree427f8f8e9f8e252316a04db92f0b52b096b9025f /mailnews/local/src/nsMsgMaildirStore.cpp
parent2c72ee1584c593b73f13665df485459014f90069 (diff)
downloaduxp-facc01c9cbbb6cf040a5334e4418129689fb9b72.tar.gz
Bug 906469 - fix maildir crash while parsing a folder.
Tag mcp-graveyard/UXP#1273
Diffstat (limited to 'mailnews/local/src/nsMsgMaildirStore.cpp')
-rw-r--r--mailnews/local/src/nsMsgMaildirStore.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/mailnews/local/src/nsMsgMaildirStore.cpp b/mailnews/local/src/nsMsgMaildirStore.cpp
index 993abbad53..6f3228938c 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()