Fix BodySnifferURLLoader::Cancel() crash on invalid WeakPtr dereference (#34003)
Add a null check for throttle_ before dereferencing in Cancel(), consistent with existing guards in OnComplete() and CompleteSniffing(). Resolves: https://github.com/brave/brave-browser/issues/52931
This commit is contained in:
@@ -450,6 +450,10 @@ void BodySnifferURLLoader::ForwardBodyToClient() {
|
||||
}
|
||||
|
||||
void BodySnifferURLLoader::Cancel() {
|
||||
if (!throttle_) {
|
||||
Abort();
|
||||
return;
|
||||
}
|
||||
throttle_->Cancel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user