summaryrefslogtreecommitdiffstats
path: root/mailnews/mapi/mapihook
diff options
context:
space:
mode:
Diffstat (limited to 'mailnews/mapi/mapihook')
-rw-r--r--mailnews/mapi/mapihook/src/msgMapiImp.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/mailnews/mapi/mapihook/src/msgMapiImp.cpp b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
index 9139d68c6..3e2bcbbf6 100644
--- a/mailnews/mapi/mapihook/src/msgMapiImp.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
@@ -152,10 +152,13 @@ STDMETHODIMP CMapiImp::Login(unsigned long aUIArg, LOGIN_PW_TYPE aLogin, LOGIN_P
nsCOMPtr <nsIMsgAccountManager> accountManager =
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
- nsCOMPtr <nsIMsgAccount> account;
- nsCOMPtr <nsIMsgIdentity> identity;
+ nsCOMPtr<nsIMsgAccount> account;
rv = accountManager->GetDefaultAccount(getter_AddRefs(account));
NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
+ if (!account)
+ return MAPI_E_LOGIN_FAILURE;
+
+ nsCOMPtr<nsIMsgIdentity> identity;
rv = account->GetDefaultIdentity(getter_AddRefs(identity));
NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
if (!identity)
@@ -270,6 +273,8 @@ nsresult CMapiImp::GetDefaultInbox(nsIMsgFolder **inboxFolder)
nsCOMPtr <nsIMsgAccount> account;
rv = accountManager->GetDefaultAccount(getter_AddRefs(account));
NS_ENSURE_SUCCESS(rv,rv);
+ if (!account)
+ return NS_ERROR_FAILURE;
// get incoming server
nsCOMPtr <nsIMsgIncomingServer> server;