Guard against callback being called twice

This commit is contained in:
Cheng Zhao 2015-08-12 13:43:27 +08:00
parent 96d53d279e
commit ee51e37db7
3 changed files with 26 additions and 19 deletions

View file

@ -64,7 +64,7 @@ class JsAsker : public RequestJob {
// Called when the JS handler has sent the response, we need to decide whether
// to start, or fail the job.
void OnResponse(bool success, scoped_ptr<base::Value> options) {
if (success) {
if (success && options) {
StartAsync(options.Pass());
} else {
RequestJob::NotifyStartError(