Null guard space inviter to prevent the app exploding

This commit is contained in:
Michael Telatynski 2021-08-05 12:30:22 +01:00
parent 58575c335d
commit a9d7d01014

View file

@ -192,11 +192,11 @@ const SpacePreview = ({ space, onJoinButtonClicked, onRejectButtonClicked }) =>
if (inviteSender) { if (inviteSender) {
inviterSection = <div className="mx_SpaceRoomView_preview_inviter"> inviterSection = <div className="mx_SpaceRoomView_preview_inviter">
<MemberAvatar member={inviter} width={32} height={32} /> <MemberAvatar member={inviter} fallbackUserId={inviteSender} width={32} height={32} />
<div> <div>
<div className="mx_SpaceRoomView_preview_inviter_name"> <div className="mx_SpaceRoomView_preview_inviter_name">
{ _t("<inviter/> invites you", {}, { { _t("<inviter/> invites you", {}, {
inviter: () => <b>{ inviter.name || inviteSender }</b>, inviter: () => <b>{ inviter?.name || inviteSender }</b>,
}) } }) }
</div> </div>
{ inviter ? <div className="mx_SpaceRoomView_preview_inviter_mxid"> { inviter ? <div className="mx_SpaceRoomView_preview_inviter_mxid">