From f87959b25c5f135d52bef7490fa1a85660fc6e48 Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Sun, 10 Mar 2024 21:31:50 -0400 Subject: [PATCH] Explicity define 404 as a null value --- .../Configuration/configPage.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index 67010ea..f69cc83 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -826,7 +826,15 @@ // make an authenticated GET to the server and parse the response as JSON async function getJson(url) { - return await fetchWithAuth(url, "GET").then(r => { return r.json(); }).catch(err => { console.debug(err) }); + return await fetchWithAuth(url, "GET") + .then(r => { + if (r.status == 404) { + return null; + } else { + return r.json(); + } + }) + .catch(err => { console.debug(err); }); } // make an authenticated fetch to the server