From bdf9ea4a6f960b03131c25c132044097322f0a40 Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Fri, 31 Jan 2025 16:20:31 +0900 Subject: [PATCH] Fix a bug on no setting file When a setting file does not exist, we unintentionally regarded the content as "404 Page not found", but we should regard it as an empty setting. --- src/web/config-loader.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/web/config-loader.mjs b/src/web/config-loader.mjs index 8029907..0d05011 100644 --- a/src/web/config-loader.mjs +++ b/src/web/config-loader.mjs @@ -94,8 +94,12 @@ export class ConfigLoader { console.debug("loadFile ", url); try { const response = await fetch(url); + console.debug("response:", response); + if (!response.ok) + { + return null; + } const data = await response.text(); - console.debug(data); return data; } catch (err) { console.error(err);