From 85e05d595de05845279a60387e7063ca5d77140f Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 20 Oct 2023 13:48:03 -0400 Subject: [PATCH] Handle json parse error when testing urls --- src/utils/dashboard.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/dashboard.js b/src/utils/dashboard.js index 1815dae241..4cca230cc2 100644 --- a/src/utils/dashboard.js +++ b/src/utils/dashboard.js @@ -56,9 +56,16 @@ export async function serverAddress() { return; } + let config; + try { + config = await resp.json(); + } catch (err) { + return; + } + return { url, - config: await resp.json() + config }; }).catch(error => { console.error(error);