From b1b2704bed5e0f6f78db58d076ff19fe1cff1777 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 3 Nov 2015 14:35:39 +0000 Subject: [PATCH] avoid racey NPE on first login --- src/skins/vector/views/molecules/RoomTile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/views/molecules/RoomTile.js b/src/skins/vector/views/molecules/RoomTile.js index 82616b5a5..bdaa621d1 100644 --- a/src/skins/vector/views/molecules/RoomTile.js +++ b/src/skins/vector/views/molecules/RoomTile.js @@ -43,12 +43,13 @@ module.exports = React.createClass({ render: function() { var myUserId = MatrixClientPeg.get().credentials.userId; + var me = this.props.room.currentState.members[myUserId]; var classes = classNames({ 'mx_RoomTile': true, 'mx_RoomTile_selected': this.props.selected, 'mx_RoomTile_unread': this.props.unread, 'mx_RoomTile_highlight': this.props.highlight, - 'mx_RoomTile_invited': this.props.room.currentState.members[myUserId].membership == 'invite' + 'mx_RoomTile_invited': (me && me.membership == 'invite'), }); var name;