diff --git a/src/components/views/rooms/InviteMemberList.js b/src/components/views/rooms/InviteMemberList.js index 8bad76b7ba..73ee4f7c27 100644 --- a/src/components/views/rooms/InviteMemberList.js +++ b/src/components/views/rooms/InviteMemberList.js @@ -42,9 +42,11 @@ module.exports = React.createClass({ // TODO: Keep this list bleeding-edge up-to-date. Practically speaking, // it will do for now not being updated as random new users join different // rooms as this list will be reloaded every room swap. - this._userList = MatrixClientPeg.get().getUsers().filter((u) => { - return !this._room.hasMembershipState(u.userId, "join"); - }); + if (this._room) { + this._userList = MatrixClientPeg.get().getUsers().filter((u) => { + return !this._room.hasMembershipState(u.userId, "join"); + }); + } }, onInvite: function(ev) {