From f903b3a5a015dd4346fabcea6d2d0026fff92d11 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 26 Jan 2000 10:18:23 +0000 Subject: [PATCH] fix crasher. now that there are no identities associated with "local folders", we have to plug this hole. --- mailnews/base/prefs/resources/content/AccountManager.js | 4 ++-- mailnews/base/src/nsMsgAccount.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mailnews/base/prefs/resources/content/AccountManager.js b/mailnews/base/prefs/resources/content/AccountManager.js index d4101446d67..1ecde3bf536 100644 --- a/mailnews/base/prefs/resources/content/AccountManager.js +++ b/mailnews/base/prefs/resources/content/AccountManager.js @@ -210,8 +210,8 @@ function onDeleteAccount() { function saveAccount(accountValues, account) { - var identity; - var server; + var identity = null; + var server = null; if (account) { identity = account.defaultIdentity; diff --git a/mailnews/base/src/nsMsgAccount.cpp b/mailnews/base/src/nsMsgAccount.cpp index 0b539a67a25..025674d8103 100644 --- a/mailnews/base/src/nsMsgAccount.cpp +++ b/mailnews/base/src/nsMsgAccount.cpp @@ -266,9 +266,11 @@ nsMsgAccount::GetDefaultIdentity(nsIMsgIdentity * *aDefaultIdentity) rv = m_identities->GetElementAt(0, &idsupports); if (NS_FAILED(rv)) return rv; - rv = idsupports->QueryInterface(NS_GET_IID(nsIMsgIdentity), - (void **)aDefaultIdentity); - NS_RELEASE(idsupports); + if (idsupports) { + rv = idsupports->QueryInterface(NS_GET_IID(nsIMsgIdentity), + (void **)aDefaultIdentity); + NS_RELEASE(idsupports); + } return rv; }