From 48e5017cb9e9467bd16876e0224c72bad4b3f6b8 Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Wed, 8 Sep 2004 18:21:52 +0000 Subject: [PATCH] fix crash adding second news account with existing name, r=me, sr=mscott, patch by kteuscher@myrealbox.com 258234 --- mailnews/base/src/nsMsgAccountManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp index b9bee765bb94..30005ba4888d 100644 --- a/mailnews/base/src/nsMsgAccountManager.cpp +++ b/mailnews/base/src/nsMsgAccountManager.cpp @@ -2081,10 +2081,12 @@ nsMsgAccountManager::findServerUrl(nsISupports *aElement, void *data) // treat "" as a wild card, so if the caller passed in "" for the desired attribute // treat it as a match - if ((!*entry->type || (strcmp(entry->type, thisType)==0)) && - (!*entry->hostname || (nsCRT::strcasecmp(entry->hostname, thisHostname)==0)) && + // NOTE: DO NOT REPLACE PL_strcmp OR PL_strcasecmp below because one or more + // of these items may be null + if ((!*entry->type || (PL_strcmp(entry->type, thisType)==0)) && + (!*entry->hostname || (PL_strcasecmp(entry->hostname, thisHostname)==0)) && (!(entry->port != 0) || (entry->port == thisPort)) && - (!*entry->username || (strcmp(entry->username, thisUsername)==0))) + (!*entry->username || (PL_strcmp(entry->username, thisUsername)==0))) { entry->server = server; return PR_FALSE; // stop on first find