From c2d9e082cb144e506a7e6e9e85a15e714da1cd4e Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 25 Oct 2017 21:01:53 -0500 Subject: [PATCH] Fix crash in custom protocols caused by bad callback exec --- atom/browser/net/url_request_fetch_job.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/browser/net/url_request_fetch_job.cc b/atom/browser/net/url_request_fetch_job.cc index ff426dd08c8e..04d0ddd1e6af 100644 --- a/atom/browser/net/url_request_fetch_job.cc +++ b/atom/browser/net/url_request_fetch_job.cc @@ -258,7 +258,9 @@ void URLRequestFetchJob::OnURLFetchComplete(const net::URLFetcher* source) { HeadersCompleted(); return; } - ReadRawDataComplete(0); + if (request_->status().is_io_pending()) { + ReadRawDataComplete(0); + } } else { NotifyStartError(fetcher_->GetStatus()); }