fedimbed: error handle new URL
This commit is contained in:
parent
9ba485083e
commit
6bff2e9eb3
1 changed files with 9 additions and 1 deletions
|
@ -105,7 +105,15 @@ async function signedFetch(url, options) {
|
|||
}
|
||||
|
||||
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
|
||||
// but these frontends are just frontends and dont actually expose the API
|
||||
|
|
Loading…
Reference in a new issue