mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 00:55:37 +00:00
fix crash on startup with missing default val for server pref, r=dmose, caillon, sr=sspitzer 182982
This commit is contained in:
parent
f6f9e3cc70
commit
823326b3fa
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user