diff --git a/src/js/room-picker.js b/src/js/room-picker.js index d2e79fa..5a5340c 100644 --- a/src/js/room-picker.js +++ b/src/js/room-picker.js @@ -106,8 +106,12 @@ class Room extends ElemJS { } // if the room has no alias, use the names of its members ("heroes") const users = this.data.summary["m.heroes"] - const usernames = users.map(u => (u.match(/^@([^:]+):/) || [])[1] || u) - return usernames.join(", ") + if (users && users.length) { + const usernames = users.map(u => (u.match(/^@([^:]+):/) || [])[1] || u) + return usernames.join(", ") + } + // the room is empty + return "Empty room" } getIcon() {