From 8cbc8db1cbb9c1fa402f5b043d399f8b16de3499 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 23 Mar 2016 11:38:17 +0000 Subject: [PATCH] oops --- src/components/structures/RoomDirectory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index de9d901c..0e0066be 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -83,7 +83,7 @@ module.exports = React.createClass({ avatarUrl: room.avatar_url, // XXX: This logic is duplicated from the JS SDK which // 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 guestRead, guestJoin, perms; 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; guestRead = null; guestJoin = null;