Skip to content

Commit

Permalink
Merge pull request #8597 from brave/search_tor_result
Browse files Browse the repository at this point in the history
Returns an empty string for failed search results
  • Loading branch information
SergeyZhukovsky authored Apr 21, 2021
2 parents 3a710ed + 865f451 commit 374ad7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/brave_search/browser/brave_search_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ void BraveSearchHost::OnURLLoaderComplete(
BraveSearchHost::FetchBackupResultsCallback callback,
const std::unique_ptr<std::string> response_body) {
url_loaders_.erase(iter);
std::move(callback).Run(*response_body);
if (response_body) {
std::move(callback).Run(*response_body);
} else {
std::move(callback).Run("");
}
}

} // namespace brave_search

0 comments on commit 374ad7c

Please sign in to comment.