LibWeb/Fetch: Actually check if the response is null in recursive fetch

The condition for checking if there was already a response in recursive
fetch was accidentally flipped, always causing a null deref.

This made redirects crash for example.
This commit is contained in:
Luke Wilde 2023-03-07 18:32:07 +00:00 committed by Linus Groh
parent 0524bc1d13
commit b91b67f4f3

View file

@ -363,7 +363,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
if (recursive == Recursive::Yes) { if (recursive == Recursive::Yes) {
// 11. If response is null, then set response to the result of running the steps corresponding to the first // 11. If response is null, then set response to the result of running the steps corresponding to the first
// matching statement: // matching statement:
auto pending_response = response auto pending_response = !response
? TRY(get_response()) ? TRY(get_response())
: PendingResponse::create(vm, request, *response); : PendingResponse::create(vm, request, *response);