1
0
Fork 0

Correctly handle actors without follow counters

This commit is contained in:
Chocobozzz 2022-07-15 11:18:29 +02:00
parent 319f9670bf
commit 654d4ede7f
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -27,8 +27,11 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode: number
}
async function fetchActorFollowsCount (actorObject: ActivityPubActor) {
const followersCount = await fetchActorTotalItems(actorObject.followers)
const followingCount = await fetchActorTotalItems(actorObject.following)
let followersCount = 0
let followingCount = 0
if (actorObject.followers) followersCount = await fetchActorTotalItems(actorObject.followers)
if (actorObject.following) followingCount = await fetchActorTotalItems(actorObject.following)
return { followersCount, followingCount }
}