if (!aDefaultAccount) return NS_ERROR_NULL_POINTER;
NS_ENSURE_ARG_POINTER(aDefaultAccount); nsresult rv; rv = LoadAccounts(); if (NS_FAILED(rv)) return rv;  PRUint32 count; if (!m_defaultAccount) { m_accounts->Count(&count); #ifdef DEBUG_ACCOUNTMANAGER printf("There are %d accounts\n", count); #endif if (count == 0) { *aDefaultAccount=nsnull; return NS_ERROR_FAILURE; }
nsMsgAccountManager::GetDefaultAccount(nsIMsgAccount * *aDefaultAccount){  if (!aDefaultAccount) return NS_ERROR_NULL_POINTER;  if (!m_defaultAccount) {#if defined(DEBUG_alecf) || defined(DEBUG_sspitzer)    printf("No default account. Looking for one..\n");#endif        findEntry entry = { nsnull, PR_FALSE, nsnull };    m_accounts->Enumerate(hashTableFindFirst, (void *)&entry);    // are there ANY entries?    if (!entry.found) return NS_ERROR_UNEXPECTED;#if defined(DEBUG_alecf) || defined(DEBUG_sspitzer)    printf("Account (%p) found\n", entry.account);#endif    m_defaultAccount = entry.account;      }  *aDefaultAccount = m_defaultAccount;  NS_ADDREF(*aDefaultAccount);  return NS_OK;}