From 6ed321e95891d2c2f69d189c1890b5d29c35b126 Mon Sep 17 00:00:00 2001 From: Dan Ghost Date: Tue, 20 Feb 2024 17:03:02 +0000 Subject: [PATCH] Fix: added optional chaining to account for fetch calls without optional settings (fixes #19). (#28) --- libraries/fetch-polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fetch-polyfill.js b/libraries/fetch-polyfill.js index 9dd417d..9c2e526 100644 --- a/libraries/fetch-polyfill.js +++ b/libraries/fetch-polyfill.js @@ -456,7 +456,7 @@ } const xhr = new XMLHttpRequest(); - const isAsync = !(init.keepalive || false); + const isAsync = !(init?.keepalive ?? false); if (isAsync) { function abortXhr() {