From d784e4980d9f23303dc15cb1a0ff83c84d70b96b Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Sun, 18 Apr 2004 19:18:17 +0000 Subject: [PATCH] minor code clean up, guard against crasher by checking rv. rs=bienvenu --- mailnews/base/src/nsMsgAccountManager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp index ff17caf4b10..39f52ffb338 100644 --- a/mailnews/base/src/nsMsgAccountManager.cpp +++ b/mailnews/base/src/nsMsgAccountManager.cpp @@ -461,8 +461,7 @@ nsMsgAccountManager::GetIncomingServer(const char* key, do_QueryInterface((nsISupports*)m_incomingServers.Get(&hashKey), &rv); if (NS_SUCCEEDED(rv)) { - *_retval = server; - NS_ADDREF(*_retval); + NS_ADDREF(*_retval = server); return NS_OK; } @@ -546,11 +545,10 @@ nsMsgAccountManager::createKeyedServer(const char* key, // waiting on root folders nsCOMPtr rootFolder; rv = server->GetRootFolder(getter_AddRefs(rootFolder)); + NS_ENSURE_SUCCESS(rv, rv); mFolderListeners->EnumerateForwards(addListenerToFolder, (void *)(nsIMsgFolder*)rootFolder); - - *aServer = server; - NS_ADDREF(*aServer); + NS_ADDREF(*aServer = server); return NS_OK; }