forked from shadowfacts/shadowfacts.net
Handle actors w/o icons
This commit is contained in:
parent
3be13e191e
commit
8490156176
|
@ -60,7 +60,7 @@ async function cacheActor(actorObject: ActorObject) {
|
||||||
function getIconUrl(icon: string | object): string {
|
function getIconUrl(icon: string | object): string {
|
||||||
return icon instanceof String ? icon : (icon as any).url;
|
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();
|
const actor = new Actor();
|
||||||
actor.id = actorObject.id;
|
actor.id = actorObject.id;
|
||||||
actor.actorObject = actorObject;
|
actor.actorObject = actorObject;
|
||||||
|
|
Loading…
Reference in New Issue