Commit 482846fd authored by tby's avatar tby Committed by Commit Bot

Fix crash in ZeroStateFileProvider.

When a FilesTaskNotifier is not available (which happens sometimes in
guest mode), the |files_ranker_| object in ZeroStateFileProvider never
gets initialized, crashing Chrome the next time it is used.

Bug: 1012911
Change-Id: Ic1d2231d4d3e9810fd16a7425a98faf94c65115e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850672
Auto-Submit: Tony Yeoman <tby@chromium.org>
Reviewed-by: default avatarCharles . <charleszhao@chromium.org>
Commit-Queue: Charles . <charleszhao@chromium.org>
Commit-Queue: Tony Yeoman <tby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704491}
parent 5e1b4cff
...@@ -79,7 +79,7 @@ ZeroStateFileProvider::~ZeroStateFileProvider() = default; ...@@ -79,7 +79,7 @@ ZeroStateFileProvider::~ZeroStateFileProvider() = default;
void ZeroStateFileProvider::Start(const base::string16& query) { void ZeroStateFileProvider::Start(const base::string16& query) {
query_start_time_ = base::TimeTicks::Now(); query_start_time_ = base::TimeTicks::Now();
ClearResultsSilently(); ClearResultsSilently();
if (!query.empty()) if (!files_ranker_ || !query.empty())
return; return;
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
......
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