Fix potential crash in OpenInputStreamWrapper::Open (fixes issue #2808)
This commit is contained in:
parent
d02d252690
commit
c90b65a72c
|
@ -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)))) {
|
||||||
|
|
Loading…
Reference in New Issue