commit | 6d4d9ceb2d705330ad8ac4593e28261e4254ea0a | [log] [tgz] |
---|---|---|
author | drbasic <[email protected]> | Wed Feb 22 10:33:59 2017 |
committer | Commit bot <[email protected]> | Wed Feb 22 10:33:59 2017 |
tree | 93b5467895f47456572809daf26c417c48b45c8d | |
parent | 59826e3fda1a3ff0352043c87eb279550134d346 [diff] [blame] |
Fix for potential crash due to scheduling an empty callback. Empty callback posted from: https://cs.chromium.org/chromium/src/chrome/browser/plugins/plugin_observer.cc?rcl=0&l=411 In other cases, callback is checked before use. Review-Url: https://codereview.chromium.org/2494343002 Cr-Commit-Position: refs/heads/master@{#451977}
diff --git a/components/component_updater/component_updater_service.cc b/components/component_updater/component_updater_service.cc index b8b27ba..15886783 100644 --- a/components/component_updater/component_updater_service.cc +++ b/components/component_updater/component_updater_service.cc
@@ -247,9 +247,11 @@ DCHECK(thread_checker_.CalledOnValidThread()); if (!GetComponent(id)) { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, update_client::Error::INVALID_ARGUMENT)); + if (!callback.is_null()) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::Bind(callback, update_client::Error::INVALID_ARGUMENT)); + } return; }