From 8490156176e44888809c21bca88283a73df9916b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 17 Sep 2019 14:19:02 -0400 Subject: [PATCH] Handle actors w/o icons --- lib/activitypub/federate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/activitypub/federate.ts b/lib/activitypub/federate.ts index 23f78aa..a4f199a 100644 --- a/lib/activitypub/federate.ts +++ b/lib/activitypub/federate.ts @@ -60,7 +60,7 @@ async function cacheActor(actorObject: ActorObject) { function getIconUrl(icon: string | object): string { return icon instanceof String ? icon : (icon as any).url; } - const iconURL: string = actorObject.icon instanceof Array ? getIconUrl(actorObject.icon[0]) : getIconUrl(actorObject.icon); + const iconURL = !actorObject.icon ? null : actorObject.icon instanceof Array ? getIconUrl(actorObject.icon[0]) : getIconUrl(actorObject.icon); const actor = new Actor(); actor.id = actorObject.id; actor.actorObject = actorObject;