fix crash adding second news account with existing name, r=me, sr=mscott, patch by kteuscher@myrealbox.com 258234

This commit is contained in:
bienvenu%nventure.com 2004-09-08 18:21:52 +00:00
Родитель 27ceb9d4da
Коммит 48e5017cb9
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -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