From 859ad58ecd9d4ba94d752f4640377c99076de10d Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 27 Aug 1999 18:23:59 +0000 Subject: [PATCH] fix for #12639 --- mailnews/base/src/nsMsgAccount.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mailnews/base/src/nsMsgAccount.cpp b/mailnews/base/src/nsMsgAccount.cpp index b5a2265a42d0..487b6e23deea 100644 --- a/mailnews/base/src/nsMsgAccount.cpp +++ b/mailnews/base/src/nsMsgAccount.cpp @@ -330,11 +330,20 @@ NS_IMETHODIMP nsMsgAccount::GetDefaultIdentity(nsIMsgIdentity * *aDefaultIdentity) { if (!aDefaultIdentity) return NS_ERROR_NULL_POINTER; - if (!m_defaultIdentity) return NS_ERROR_NULL_POINTER; + nsresult rv; + if (!m_identities) { + rv = Init(); + if (NS_FAILED(rv)) return rv; + } + + nsISupports* idsupports; + rv = m_identities->GetElementAt(0, &idsupports); + if (NS_FAILED(rv)) return rv; - // *aDefaultIdentity = m_defaultIdentity; - *aDefaultIdentity = nsnull; - return NS_OK; + rv = idsupports->QueryInterface(NS_GET_IID(nsIMsgIdentity), + (void **)aDefaultIdentity); + NS_RELEASE(idsupports); + return rv; } // todo - make sure this is in the identity array!