diff --git a/mailnews/imap/src/nsImapService.cpp b/mailnews/imap/src/nsImapService.cpp index 92456222032..d1075be5ffe 100644 --- a/mailnews/imap/src/nsImapService.cpp +++ b/mailnews/imap/src/nsImapService.cpp @@ -2721,15 +2721,16 @@ NS_IMETHODIMP nsImapService::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI NS_MSGACCOUNTMANAGER_PROGID, &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr aServer; + nsCOMPtr server; rv = accountManager->FindServer(userName, hostName, "imap", - getter_AddRefs(aServer)); + getter_AddRefs(server)); // if we can't extract the imap server from this url then give up!!! if (NS_FAILED(rv)) return rv; + NS_ENSURE_TRUE(server, NS_ERROR_FAILURE); // now try to get the folder in question... nsCOMPtr aRootFolder; - aServer->GetRootFolder(getter_AddRefs(aRootFolder)); + server->GetRootFolder(getter_AddRefs(aRootFolder)); if (aRootFolder && folderName && (* ((const char *) folderName)) ) {