Don't barf if we we can't get a given room ID
parent
67d3368e1e
commit
2eba2280d8
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue