From b91b67f4f3fcfeba183a73d8f8c56fb5c810bc0d Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Tue, 7 Mar 2023 18:32:07 +0000 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index d95438b5ab..c90c72757c 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -363,7 +363,7 @@ WebIDL::ExceptionOr>> main_fetch(JS:: if (recursive == Recursive::Yes) { // 11. If response is null, then set response to the result of running the steps corresponding to the first // matching statement: - auto pending_response = response + auto pending_response = !response ? TRY(get_response()) : PendingResponse::create(vm, request, *response);