From 968d14d702d7405c4c60eeec90f38078d7e20b4b Mon Sep 17 00:00:00 2001 From: fflorent Date: Thu, 18 Apr 2024 17:27:45 +0200 Subject: [PATCH] Remove check of whether prefix is set --- app/common/UserAPI.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/common/UserAPI.ts b/app/common/UserAPI.ts index e9f3fa23..08f9df80 100644 --- a/app/common/UserAPI.ts +++ b/app/common/UserAPI.ts @@ -1171,11 +1171,7 @@ export type PublicDocWorkerUrlInfo = { docWorkerUrl: string|null; } -export function getUrlFromPrefix(homeUrl: string, prefix: string|null) { - if (!prefix) { - // This should never happen. - throw new Error('missing selfPrefix for docWorkerUrl'); - } +export function getUrlFromPrefix(homeUrl: string, prefix: string) { const url = new URL(homeUrl); url.pathname = prefix + url.pathname; return url.href;