diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index f1bf93cf8f..d2b9aba3d9 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -485,7 +485,7 @@ export default class EventListSummary extends React.Component { if (e.target && TARGET_AS_DISPLAY_NAME_EVENTS.includes(type as EventType)) { latestUserAvatarMember.set(userId, e.target); - } else { + } else if (e.sender) { latestUserAvatarMember.set(userId, e.sender); } @@ -494,7 +494,7 @@ export default class EventListSummary extends React.Component { displayName = e.getContent().display_name; } else if (e.target && TARGET_AS_DISPLAY_NAME_EVENTS.includes(type as EventType)) { displayName = e.target.name; - } else { + } else if (e.sender) { displayName = e.sender.name; }