зеркало из https://github.com/mozilla/gecko-dev.git
Bug 634936 - Add null-check for nsContentUtils::GetPrefBranch() to prevent Crash [@ nsFocusManager::Init ]; r=jst
This commit is contained in:
Родитель
2f869e0bd1
Коммит
002581d137
|
@ -196,9 +196,11 @@ nsFocusManager::Init()
|
|||
nsContentUtils::GetBoolPref("accessibility.mouse_focuses_formcontrol", PR_FALSE);
|
||||
|
||||
nsIPrefBranch2* prefBranch = nsContentUtils::GetPrefBranch();
|
||||
prefBranch->AddObserver("accessibility.browsewithcaret", fm, PR_TRUE);
|
||||
prefBranch->AddObserver("accessibility.tabfocus_applies_to_xul", fm, PR_TRUE);
|
||||
prefBranch->AddObserver("accessibility.mouse_focuses_formcontrol", fm, PR_TRUE);
|
||||
if (prefBranch) {
|
||||
prefBranch->AddObserver("accessibility.browsewithcaret", fm, PR_TRUE);
|
||||
prefBranch->AddObserver("accessibility.tabfocus_applies_to_xul", fm, PR_TRUE);
|
||||
prefBranch->AddObserver("accessibility.mouse_focuses_formcontrol", fm, PR_TRUE);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
|
|
|
@ -1891,11 +1891,11 @@ static const char kIconLoadPrefs[][40] = {
|
|||
nsImageFrame::IconLoad::IconLoad()
|
||||
{
|
||||
nsIPrefBranch2* prefBranch = nsContentUtils::GetPrefBranch();
|
||||
|
||||
// register observers
|
||||
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kIconLoadPrefs); ++i)
|
||||
prefBranch->AddObserver(kIconLoadPrefs[i], this, PR_FALSE);
|
||||
|
||||
if (prefBranch) {
|
||||
// register observers
|
||||
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kIconLoadPrefs); ++i)
|
||||
prefBranch->AddObserver(kIconLoadPrefs[i], this, PR_FALSE);
|
||||
}
|
||||
GetPrefs();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче