From 0daab63b4af945ca88e34398b95f84f21c4cdb95 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 9 Jul 2015 11:31:58 +0100 Subject: [PATCH] Bad workaround for some join events having no sender --- skins/base/views/molecules/MRoomMemberTile.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/skins/base/views/molecules/MRoomMemberTile.js b/skins/base/views/molecules/MRoomMemberTile.js index 862deb5dac..7f202016e3 100644 --- a/skins/base/views/molecules/MRoomMemberTile.js +++ b/skins/base/views/molecules/MRoomMemberTile.js @@ -29,13 +29,15 @@ module.exports = React.createClass({ getMemberEventText: function() { var ev = this.props.mxEvent; + // XXX: SYJS-16 + var senderName = ev.sender ? ev.sender.name : "Someone"; switch (ev.getContent().membership) { case 'invite': - return ev.sender.name + " invited " + ev.target.name + "."; + return senderName + " invited " + ev.target.name + "."; case 'join': - return ev.sender.name + " joined the room."; + return senderName + " joined the room."; case 'leave': - return ev.sender.name + " left the room."; + return senderName + " left the room."; } },