Skip to content

Commit d6fd878

Browse files
Don't except with empty URLs in isExternalLink
1 parent f477866 commit d6fd878

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/scripts/Utils/PageUtils/page.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ export function isExternalLink(url: string): boolean {
1010
"https://awesome-arcade.vercel.app",
1111
"https://awesome-arcade-beta.vercel.app",
1212
];
13-
return !urls.some((u) => {
14-
return new URL(url).host === new URL(u).host;
15-
});
13+
try {
14+
return !urls.some((u) => {
15+
return new URL(url).host === new URL(u).host;
16+
});
17+
} catch {
18+
return false;
19+
}
1620
}
1721
}
1822

0 commit comments

Comments
 (0)