0

Fix misskey-specific error of existing-but-null avatar. Closes #1689

This commit is contained in:
Gabe Kangas 2022-01-20 14:56:04 -08:00
parent 372b1059c0
commit a471707a54
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA

View File

@ -52,7 +52,7 @@ func MakeActorFromPerson(person vocab.ActivityStreamsPerson) ActivityPubActor {
W3IDSecurityV1PublicKey: person.GetW3IDSecurityV1PublicKey(),
}
if person.GetActivityStreamsIcon() != nil && person.GetActivityStreamsIcon().Len() > 0 {
if person.GetActivityStreamsIcon() != nil && person.GetActivityStreamsIcon().Len() > 0 && person.GetActivityStreamsIcon().At(0).GetActivityStreamsImage() != nil {
apActor.Image = person.GetActivityStreamsIcon().At(0).GetActivityStreamsImage().GetActivityStreamsUrl().Begin().GetIRI()
}
@ -71,7 +71,7 @@ func MakeActorFromService(service vocab.ActivityStreamsService) ActivityPubActor
W3IDSecurityV1PublicKey: service.GetW3IDSecurityV1PublicKey(),
}
if service.GetActivityStreamsIcon() != nil && service.GetActivityStreamsIcon().Len() > 0 {
if service.GetActivityStreamsIcon() != nil && service.GetActivityStreamsIcon().Len() > 0 && service.GetActivityStreamsIcon().At(0).GetActivityStreamsImage() != nil {
apActor.Image = service.GetActivityStreamsIcon().At(0).GetActivityStreamsImage().GetActivityStreamsUrl().Begin().GetIRI()
}