fix crash on startup with missing default val for server pref, r=dmose, caillon, sr=sspitzer 182982

This commit is contained in:
bienvenu%netscape.com 2002-12-11 00:30:18 +00:00
parent f6f9e3cc70
commit 823326b3fa

View File

@ -625,16 +625,14 @@ nsMsgIncomingServer::SetCharValue(const char *prefname,
return NS_OK;
}
char *defaultVal=nsnull;
rv = getDefaultCharPref(prefname, &defaultVal);
nsXPIDLCString defaultVal;
rv = getDefaultCharPref(prefname, getter_Copies(defaultVal));
if (NS_SUCCEEDED(rv) && strcmp(defaultVal, val) == 0)
if (NS_SUCCEEDED(rv) && defaultVal.Equals(val))
m_prefBranch->ClearUserPref(fullPrefName.get());
else
rv = m_prefBranch->SetCharPref(fullPrefName.get(), val);
PR_FREEIF(defaultVal);
return rv;
}