From 4766a801382e6373b982a2731cdc7ea24f0c70b3 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 29 Nov 2023 23:54:23 +0100 Subject: Catch errors in fileExists --- webAO/utils/fileExists.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'webAO/utils') diff --git a/webAO/utils/fileExists.ts b/webAO/utils/fileExists.ts index 06621e4..f1a9924 100644 --- a/webAO/utils/fileExists.ts +++ b/webAO/utils/fileExists.ts @@ -3,5 +3,7 @@ export default async function fileExists(url: string): Promise { method: 'HEAD', }).then((response) => { return response.ok; + }).catch(() => { + return false; }); } -- cgit