зеркало из https://github.com/mozilla/gecko-dev.git
bulletproof the nsMsgAccount object
This commit is contained in:
Родитель
756c4d18bc
Коммит
cab8e013a0
|
@ -96,6 +96,9 @@ nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer * *aIncomingServer)
|
|||
if (!aIncomingServer) return NS_ERROR_NULL_POINTER;
|
||||
nsresult rv;
|
||||
|
||||
// need to call SetKey() first!
|
||||
if (!m_accountKey) return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// create the incoming server lazily
|
||||
if (!m_incomingServer) {
|
||||
// from here, load mail.account.myaccount.server
|
||||
|
@ -111,6 +114,9 @@ nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer * *aIncomingServer)
|
|||
rv = m_prefs->CopyCharPref(serverKeyPref, &serverKey);
|
||||
PR_FREEIF(serverKeyPref);
|
||||
|
||||
// the server pref doesn't exist
|
||||
if (NS_FAILED(rv)) return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
#ifdef DEBUG_alecf
|
||||
printf("\t%s's server: %s\n", m_accountKey, serverKey);
|
||||
#endif
|
||||
|
@ -123,6 +129,9 @@ nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer * *aIncomingServer)
|
|||
rv = m_prefs->CopyCharPref(serverTypePref, &serverType);
|
||||
PR_FREEIF(serverTypePref);
|
||||
|
||||
// the server type doesn't exist!
|
||||
if (NS_FAILED(rv)) return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
#ifdef DEBUG_alecf
|
||||
if (NS_FAILED(rv)) {
|
||||
printf("\tCould not read pref %s\n", serverTypePref);
|
||||
|
|
Загрузка…
Ссылка в новой задаче