diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-11 02:10:24 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-11 02:10:24 -0500 |
commit | c6df8fffbc568a81c5f477d6ff9c240500faeb0c (patch) | |
tree | 97b9b4d5ba4130ed1c60a6668153f83ddcf997a4 /mailnews | |
parent | 7406d488b363588be8f677f698be11ea478f377b (diff) | |
download | UXP-c6df8fffbc568a81c5f477d6ff9c240500faeb0c.tar UXP-c6df8fffbc568a81c5f477d6ff9c240500faeb0c.tar.gz UXP-c6df8fffbc568a81c5f477d6ff9c240500faeb0c.tar.lz UXP-c6df8fffbc568a81c5f477d6ff9c240500faeb0c.tar.xz UXP-c6df8fffbc568a81c5f477d6ff9c240500faeb0c.zip |
Bug 786683 - check success of GetFilePath() throughout nsMsgBrkMBoxStore.cpp.
Tag #1273
Diffstat (limited to 'mailnews')
-rw-r--r-- | mailnews/local/src/nsMsgBrkMBoxStore.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/mailnews/local/src/nsMsgBrkMBoxStore.cpp b/mailnews/local/src/nsMsgBrkMBoxStore.cpp index 1ab464385..739d49d0a 100644 --- a/mailnews/local/src/nsMsgBrkMBoxStore.cpp +++ b/mailnews/local/src/nsMsgBrkMBoxStore.cpp @@ -626,14 +626,16 @@ nsMsgBrkMBoxStore::GetNewMsgOutputStream(nsIMsgFolder *aFolder, m_streamOutstandingFolder = aFolder; #endif *aReusable = true; + + nsresult rv; nsCOMPtr<nsIFile> mboxFile; - aFolder->GetFilePath(getter_AddRefs(mboxFile)); + rv = aFolder->GetFilePath(getter_AddRefs(mboxFile)); + NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIMsgDatabase> db; aFolder->GetMsgDatabase(getter_AddRefs(db)); if (!db && !*aNewMsgHdr) NS_WARNING("no db, and no message header"); - bool exists; - nsresult rv; + bool exists = false; mboxFile->Exists(&exists); if (!exists) { rv = mboxFile->Create(nsIFile::NORMAL_FILE_TYPE, 0600); @@ -701,7 +703,8 @@ nsMsgBrkMBoxStore::DiscardNewMessage(nsIOutputStream *aOutputStream, nsCOMPtr<nsIMsgFolder> folder; nsresult rv = aNewHdr->GetFolder(getter_AddRefs(folder)); NS_ENSURE_SUCCESS(rv, rv); - folder->GetFilePath(getter_AddRefs(mboxFile)); + rv = folder->GetFilePath(getter_AddRefs(mboxFile)); + NS_ENSURE_SUCCESS(rv, rv); return mboxFile->SetFileSize(hdrOffset); } @@ -757,7 +760,8 @@ nsMsgBrkMBoxStore::GetMsgInputStream(nsIMsgFolder *aMsgFolder, *aReusable = true; nsCOMPtr<nsIFile> mboxFile; - aMsgFolder->GetFilePath(getter_AddRefs(mboxFile)); + nsresult rv = aMsgFolder->GetFilePath(getter_AddRefs(mboxFile)); + NS_ENSURE_SUCCESS(rv, rv); return NS_NewLocalFileInputStream(aResult, mboxFile); } @@ -870,10 +874,11 @@ nsMsgBrkMBoxStore::GetOutputStream(nsIArray *aHdrArray, m_outputStreams.Remove(URI); } } - nsCOMPtr<nsIFile> mboxFile; - folder->GetFilePath(getter_AddRefs(mboxFile)); if (!outputStream) { + nsCOMPtr<nsIFile> mboxFile; + rv = folder->GetFilePath(getter_AddRefs(mboxFile)); + NS_ENSURE_SUCCESS(rv, rv); rv = MsgGetFileStream(mboxFile, getter_AddRefs(outputStream)); seekableStream = do_QueryInterface(outputStream); if (NS_SUCCEEDED(rv)) |