fedimbed: error handle new URL

This commit is contained in:
Cynthia Foxwell 2023-11-22 14:20:48 -07:00
parent 9ba485083e
commit 6bff2e9eb3

View file

@ -105,7 +105,15 @@ async function signedFetch(url, options) {
} }
async function processUrl(msg, url, spoiler = false) { async function processUrl(msg, url, spoiler = false) {
let urlObj = new URL(url); let invalidUrl = false;
let urlObj;
try {
urlObj = new URL(url);
} catch {
invalidUrl = true;
}
if (invalidUrl) return;
// some lemmy instances have old reddit frontend subdomains // some lemmy instances have old reddit frontend subdomains
// but these frontends are just frontends and dont actually expose the API // but these frontends are just frontends and dont actually expose the API