Handle actors w/o icons

This commit is contained in:
Shadowfacts 2019-09-17 14:19:02 -04:00
parent 3be13e191e
commit 8490156176
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 1 deletions

View File

@ -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;