Skip to content

Commit

Permalink
Bug 1278439 - Adding a missing prefs service null check in chrome/. r…
Browse files Browse the repository at this point in the history
…=froydnj.

--HG--
extra : rebase_source : e1a3b142818311e74c566da49534727189075b9e
  • Loading branch information
nnethercote committed Jul 14, 2016
1 parent 303d9bf commit 2715b3a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions chrome/nsChromeRegistryChrome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2715b3a

Please sign in to comment.