diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 5971c69326..e64dd66d6b 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -119,8 +119,13 @@ ActivityPub.resolveInboxes = async (ids) => { if (!meta.config.activitypubAllowLoopback) { ids = ids.filter((id) => { - const { hostname } = new URL(id); - return hostname !== nconf.get('url_parsed').hostname; + try { + const { hostname } = new URL(id); + return hostname !== nconf.get('url_parsed').hostname; + } catch (err) { + winston.error(`[activitypub/resolveInboxes] Invalid id: ${id}`); + return false; + } }); }