summaryrefslogtreecommitdiffstats
path: root/mailnews/local/src/nsMsgBrkMBoxStore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mailnews/local/src/nsMsgBrkMBoxStore.cpp')
-rw-r--r--mailnews/local/src/nsMsgBrkMBoxStore.cpp19
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))