Bug 1278439 - Adding a missing prefs service null check in chrome/. r=froydnj.

--HG--
extra : rebase_source : e1a3b142818311e74c566da49534727189075b9e
This commit is contained in:
Nicholas Nethercote 2016-07-14 13:47:49 +10:00
parent 303d9bf656
commit 2715b3a3ef

View File

@ -123,15 +123,17 @@ nsChromeRegistryChrome::Init()
nsCOMPtr<nsIPrefService> prefserv (do_GetService(NS_PREFSERVICE_CONTRACTID));
nsCOMPtr<nsIPrefBranch> prefs;
if (safeMode)
prefserv->GetDefaultBranch(nullptr, getter_AddRefs(prefs));
else
prefs = do_QueryInterface(prefserv);
if (prefserv) {
if (safeMode) {
prefserv->GetDefaultBranch(nullptr, getter_AddRefs(prefs));
} else {
prefs = do_QueryInterface(prefserv);
}
}
if (!prefs) {
NS_WARNING("Could not get pref service!");
}
else {
} else {
nsXPIDLCString provider;
rv = prefs->GetCharPref(SELECTED_SKIN_PREF, getter_Copies(provider));
if (NS_SUCCEEDED(rv))