Make sure we can call displayName with eventually undefined actor
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
c216172d44
commit
79872b47df
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user