mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 07:24:47 +00:00
Bug 1594083 - Check if we got the pref service before using it to avoid a crash r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D59016 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e789bfccec
commit
7f4ece010f
@ -72,8 +72,14 @@ Fuzzyfox::Fuzzyfox()
|
||||
|
||||
sFuzzyfoxInitializing = fuzzyfoxEnabled;
|
||||
|
||||
// Should I see if these fail? And do what?
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (!prefs) {
|
||||
// Sometimes the call to the pref service fails. If that happens, we
|
||||
// don't add the observers. The user will have to restart to have
|
||||
// preference changes take effect.
|
||||
return;
|
||||
}
|
||||
|
||||
prefs->AddObserver(FUZZYFOX_ENABLED_PREF, this, false);
|
||||
prefs->AddObserver(FUZZYFOX_CLOCKGRAIN_PREF, this, false);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user