From fa81078a89d7de0d5c1ce10c3294312197c4d2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 24 Dec 2024 20:54:49 -0500 Subject: [PATCH] fix: check if url is undefined --- src/controllers/activitypub/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/activitypub/index.js b/src/controllers/activitypub/index.js index bda06afc94..ad18451d04 100644 --- a/src/controllers/activitypub/index.js +++ b/src/controllers/activitypub/index.js @@ -48,6 +48,9 @@ Controller.fetch = async (req, res, next) => { helpers.redirect(res, url.href, false); } catch (e) { + if (!url || !url.href) { + return next(); + } activitypub.helpers.log(`[activitypub/fetch] Invalid URL received: ${url}`); helpers.redirect(res, url.href, false); }