We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7acb06 commit 6e9bc6eCopy full SHA for 6e9bc6e
1 file changed
assets/js/dashboard/util/url.ts
@@ -10,9 +10,13 @@ export function apiPath(
10
export function externalLinkForPage(
11
domain: PlausibleSite['domain'],
12
page: string
13
-): string {
14
- const domainURL = new URL(`https://${domain}`)
15
- return `https://${domainURL.host}${page}`
+): string | null {
+ try {
+ const domainURL = new URL(`https://${domain}`)
16
+ return `https://${domainURL.host}${page}`
17
+ } catch (_error) {
18
+ return null
19
+ }
20
}
21
22
export function isValidHttpUrl(input: string): boolean {
0 commit comments