Bug 1265262 - Check for null root branch when registering pref watcher. r=froydnj

This commit is contained in:
Eric Rahm 2016-08-10 12:48:55 -07:00
Родитель 565cdb97f5
Коммит dad6ca00c0
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -51,10 +51,14 @@ LoadPrefValue(const char* aName)
void
LoadExistingPrefs()
{
nsIPrefBranch* root = Preferences::GetRootBranch();
if (!root) {
return;
}
uint32_t count;
char** names;
nsresult rv = Preferences::GetRootBranch()->
GetChildList(kLoggingPrefPrefix, &count, &names);
nsresult rv = root->GetChildList(kLoggingPrefPrefix, &count, &names);
if (NS_SUCCEEDED(rv) && count) {
for (size_t i = 0; i < count; i++) {
LoadPrefValue(names[i]);