Bug 604506 - trunk crash [@ nsMsgDatabase::GetDBFolderInfo(nsIDBFolderInfo**)]; r=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 26 Oct 2010 17:46:07 +0100
changeset 6602 9d32de38d7027d7d02268d79cb943433c7cc8728
parent 6601 1e9ad9328bd98e41c53fa8d53b9f3415a30faad8
child 6603 0930e772903bc5f79213c6eb90ed1bcbb077d702
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs604506
Bug 604506 - trunk crash [@ nsMsgDatabase::GetDBFolderInfo(nsIDBFolderInfo**)]; r=bienvenu
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -1409,24 +1409,25 @@ if (m_mdbAllMsgHeadersTable)
 
   // better not be any listeners, because we're going away.
   NS_ASSERTION(m_ChangeListeners.IsEmpty(), "shouldn't have any listeners left");
 
   Release();
   return err;
 }
 
-// caller must Release result.
 NS_IMETHODIMP nsMsgDatabase::GetDBFolderInfo(nsIDBFolderInfo  **result)
 {
+  if (!m_dbFolderInfo)
+  {
+    NS_ERROR("db must be corrupt");
+    return NS_ERROR_NULL_POINTER;
+  }
   NS_ADDREF(*result = m_dbFolderInfo);
-  if (m_dbFolderInfo)
-    return NS_OK;
-  NS_ERROR("db must be corrupt");
-  return NS_ERROR_NULL_POINTER; // it's an error if we can't get this
+  return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDatabase::Commit(nsMsgDBCommit commitType)
 {
   nsresult  err = NS_OK;
   nsIMdbThumb  *commitThumb = NULL;
 
 #ifdef DEBUG_seth