fix: check if url is undefined

This commit is contained in:
Barış Soner Uşaklı
2024-12-24 20:54:49 -05:00
parent 0087764ce0
commit fa81078a89

View File

@@ -48,6 +48,9 @@ Controller.fetch = async (req, res, next) => {
helpers.redirect(res, url.href, false); helpers.redirect(res, url.href, false);
} catch (e) { } catch (e) {
if (!url || !url.href) {
return next();
}
activitypub.helpers.log(`[activitypub/fetch] Invalid URL received: ${url}`); activitypub.helpers.log(`[activitypub/fetch] Invalid URL received: ${url}`);
helpers.redirect(res, url.href, false); helpers.redirect(res, url.href, false);
} }