diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 22:51:10 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 22:51:10 -0500 |
commit | 5d21f962db500a22697221d985709d5f24fa27f5 (patch) | |
tree | 76abad17d6a77770009f6b19ea3cc2b3cb9e88aa /mailnews/mapi/mapihook | |
parent | 2fda56a84eca7a08f626704e81b5c4c571623e44 (diff) | |
download | UXP-5d21f962db500a22697221d985709d5f24fa27f5.tar UXP-5d21f962db500a22697221d985709d5f24fa27f5.tar.gz UXP-5d21f962db500a22697221d985709d5f24fa27f5.tar.lz UXP-5d21f962db500a22697221d985709d5f24fa27f5.tar.xz UXP-5d21f962db500a22697221d985709d5f24fa27f5.zip |
Bug 342632 - Allow defaultAccount to return success with nullptr result when there is no usable account.
Tag #1273
Diffstat (limited to 'mailnews/mapi/mapihook')
-rw-r--r-- | mailnews/mapi/mapihook/src/msgMapiImp.cpp | 9 |
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; |