Bug 1278439 - Adding missing prefs service null checks in netwerk/. r=valentin.

This commit is contained in:
Nicholas Nethercote
2016-07-14 13:47:44 +10:00
parent f0a37992e9
commit 2e5d18a8ba
4 changed files with 8 additions and 8 deletions

View File

@@ -412,9 +412,12 @@ nsCacheProfilePrefObserver::Observe(nsISupports * subject,
// profile after change
mHaveProfile = true;
nsCOMPtr<nsIPrefBranch> branch = do_GetService(NS_PREFSERVICE_CONTRACTID);
ReadPrefs(branch);
if (!branch) {
return NS_ERROR_FAILURE;
}
(void)ReadPrefs(branch);
nsCacheService::OnProfileChanged();
} else if (!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, topic)) {
// ignore pref changes until we're done switch profiles