Don't barf if we we can't get a given room ID

This commit is contained in:
David Baker 2015-07-21 20:34:55 -07:00
parent 67d3368e1e
commit 2eba2280d8

View File

@ -113,7 +113,9 @@ module.exports = {
roomMembers: function(limit) { roomMembers: function(limit) {
if (!this.props.roomId) return {}; if (!this.props.roomId) return {};
var cli = MatrixClientPeg.get(); var cli = MatrixClientPeg.get();
var all_members = cli.getRoom(this.props.roomId).currentState.members; var room = cli.getRoom(this.props.roomId);
if (!room) return {};
var all_members = room.currentState.members;
var all_user_ids = Object.keys(all_members); var all_user_ids = Object.keys(all_members);
all_user_ids.sort(function(userIdA, userIdB) { all_user_ids.sort(function(userIdA, userIdB) {