diff --git a/mailnews/base/src/nsMsgAccount.cpp b/mailnews/base/src/nsMsgAccount.cpp index 5e08d0feedd..918e4d2e2e6 100644 --- a/mailnews/base/src/nsMsgAccount.cpp +++ b/mailnews/base/src/nsMsgAccount.cpp @@ -245,6 +245,7 @@ NS_IMETHODIMP nsMsgAccount::GetDefaultIdentity(nsIMsgIdentity **aDefaultIdentity) { NS_ENSURE_ARG_POINTER(aDefaultIdentity); + *aDefaultIdentity = nsnull; nsresult rv; if (!m_identities) @@ -253,7 +254,7 @@ nsMsgAccount::GetDefaultIdentity(nsIMsgIdentity **aDefaultIdentity) NS_ENSURE_SUCCESS(rv, rv); } - nsCOMPtr identity( do_QueryElementAt(m_identities, 0)); + nsCOMPtr identity( do_QueryElementAt(m_identities, 0, &rv)); identity.swap(*aDefaultIdentity); return rv; }