1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-30 11:55:26 +00:00

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);
}