Explicity define 404 as a null value

This commit is contained in:
TwistedUmbrellaX 2024-03-10 21:31:50 -04:00
parent 3edeb97a2c
commit f87959b25c

View File

@ -826,7 +826,15 @@
// make an authenticated GET to the server and parse the response as JSON // make an authenticated GET to the server and parse the response as JSON
async function getJson(url) { 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 // make an authenticated fetch to the server