Commit 2f2f39f6 authored by alito's avatar alito Committed by Commit bot

Settings reset prompt: Fix crash when fetching default settings.

When the Chrome installation has a brand code, the SettingsResetPromptModel may try to fetch default settings over the network. If the fetch fails, the ProfileResetter is passed a null pointer and any attempt to reset a setting will crash.

BUG=716372

Review-Url: https://codereview.chromium.org/2852883002
Cr-Commit-Position: refs/heads/master@{#468270}
parent 303d2fcb
......@@ -136,7 +136,13 @@ void DefaultSettingsFetcher::OnSettingsFetched() {
DCHECK(config_fetcher_);
DCHECK(!config_fetcher_->IsActive());
PostCallbackAndDeleteSelf(config_fetcher_->GetSettings());
std::unique_ptr<BrandcodedDefaultSettings> settings(
config_fetcher_->GetSettings());
// Use default settings if fetching of BrandcodedDefaultSettings fails.
if (!settings)
settings.reset(new BrandcodedDefaultSettings());
PostCallbackAndDeleteSelf(std::move(settings));
}
void DefaultSettingsFetcher::PostCallbackAndDeleteSelf(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment