mirror of https://github.com/Chocobozzz/PeerTube
Correctly handle actors without follow counters
parent
319f9670bf
commit
654d4ede7f
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue