From 79872b47dfbe1ff06bdf70b14fb0cd649c51c340 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 20 Apr 2022 15:30:17 +0200 Subject: [PATCH] Make sure we can call displayName with eventually undefined actor Signed-off-by: Thomas Citharel --- js/src/types/actor/actor.model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/types/actor/actor.model.ts b/js/src/types/actor/actor.model.ts index 9b732a901..984c7f33c 100644 --- a/js/src/types/actor/actor.model.ts +++ b/js/src/types/actor/actor.model.ts @@ -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); }