This commit is contained in:
Matthew Hodgson 2016-03-23 11:38:17 +00:00
parent e32299a50c
commit 8cbc8db1cb

View file

@ -83,7 +83,7 @@ module.exports = React.createClass({
avatarUrl: room.avatar_url, avatarUrl: room.avatar_url,
// XXX: This logic is duplicated from the JS SDK which // XXX: This logic is duplicated from the JS SDK which
// would normally decide what the name is. // would normally decide what the name is.
name: room.name || room.canonical_alias || room.aliases[0], name: room.name || room.canonical_alias || (room.aliases ? room.aliases[0] : "Unnamed room"),
}; };
} }
@ -112,7 +112,7 @@ module.exports = React.createClass({
var self = this; var self = this;
var guestRead, guestJoin, perms; var guestRead, guestJoin, perms;
for (var i = 0; i < rooms.length; i++) { for (var i = 0; i < rooms.length; i++) {
var alias = rooms[i].canonical_alias || rooms[i].aliases[0]; var alias = rooms[i].canonical_alias || (rooms[i].aliases ? rooms[i].aliases[0] : "Unnamed room");
var name = rooms[i].name || alias; var name = rooms[i].name || alias;
guestRead = null; guestRead = null;
guestJoin = null; guestJoin = null;