Make sure we can call displayName with eventually undefined actor

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-04-20 15:30:17 +02:00
parent c216172d44
commit 79872b47df
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -68,7 +68,7 @@ export function usernameWithDomain(actor: IActor, force = false): string {
}
export function displayName(actor: IActor): string {
return actor.name != null && actor.name !== ""
return actor && actor.name != null && actor.name !== ""
? actor.name
: usernameWithDomain(actor);
}