Skip to content

Node.js based forum software built for the modern web

fix: another crash

Barış Soner Uşaklıf8d9f644e66a
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;
};