Commit 0a7c19df authored by Rainhard Findling's avatar Rainhard Findling Committed by Commit Bot

Safety check Chrome cleaner: fix: handle unavailable prefs

Bug: 1087263,1139806
Change-Id: I2bafbcb8b9fdd9a806e7d5bef68d200dd025ab4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505137Reviewed-by: default avatarJoe Mason <joenotcharles@chromium.org>
Commit-Queue: Rainhard Findling <rainhard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821719}
parent ed483842
......@@ -667,8 +667,11 @@ void ChromeCleanerControllerImpl::OnPromptUser(
// timestamp also to a pref. This ensures that the timestamp is preserved
// in case Chrome is still opened when the scan completes. Remove this
// workaround once the timestamp is written to the registry in all cases.
g_browser_process->local_state()->SetTime(
prefs::kChromeCleanerScanCompletionTime, base::Time::Now());
PrefService* pref_service = g_browser_process->local_state();
if (pref_service) {
pref_service->SetTime(prefs::kChromeCleanerScanCompletionTime,
base::Time::Now());
}
return;
}
......
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