From f8d9f644e66a295cbe8ccc27b28885060f7f1c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 7 Jun 2024 11:55:21 -0400 Subject: [PATCH] fix: another crash --- src/activitypub/actors.js | 2 +- src/activitypub/mocks.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/activitypub/actors.js b/src/activitypub/actors.js index 6f25d67ae0..1faaccd5b0 100644 --- a/src/activitypub/actors.js +++ b/src/activitypub/actors.js @@ -122,7 +122,7 @@ Actors.assert = async (ids, options = {}) => { actors = actors.filter(Boolean); // remove unresolvable actors // Build userData object for storage - const profiles = await activitypub.mocks.profile(actors); + const profiles = (await activitypub.mocks.profile(actors)).filter(Boolean); const now = Date.now(); const bulkSet = profiles.reduce((memo, profile) => { diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index 975f9f617c..c434e33639 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -29,7 +29,7 @@ const sanitizeConfig = { Mocks.profile = async (actors) => { // Should only ever be called by activitypub.actors.assert - const profiles = (await Promise.all(actors.map(async (actor) => { + const profiles = await Promise.all(actors.map(async (actor) => { if (!actor) { return null; } @@ -78,7 +78,7 @@ Mocks.profile = async (actors) => { }; return payload; - }))); + })); return profiles; };