Fix potential crash in OpenInputStreamWrapper::Open (fixes issue #2808)

This commit is contained in:
Marshall Greenblatt 2020-01-15 16:46:18 +01:00
parent d02d252690
commit c90b65a72c
1 changed files with 5 additions and 4 deletions

View File

@ -90,7 +90,8 @@ class OpenInputStreamWrapper
void Open(const RequestId& request_id, void Open(const RequestId& request_id,
const network::ResourceRequest& request) { const network::ResourceRequest& request) {
if (!delegate_->OpenInputStream( // |delegate_| may be null if we were canceled.
if (delegate_ && !delegate_->OpenInputStream(
request_id, request, request_id, request,
base::BindOnce(&OpenInputStreamWrapper::OnCallback, base::BindOnce(&OpenInputStreamWrapper::OnCallback,
base::WrapRefCounted(this)))) { base::WrapRefCounted(this)))) {