make sure aliases and heroes aren't empty when picking name

This commit is contained in:
Bruno Windels 2019-11-22 09:29:18 +01:00
parent 2848e85c87
commit 8a55778c32
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "brawl-chat", "name": "brawl-chat",
"version": "0.0.10", "version": "0.0.11",
"description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB", "description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB",
"main": "index.js", "main": "index.js",
"directories": { "directories": {

View file

@ -26,10 +26,10 @@ export default class RoomSummary {
if (this._canonicalAlias) { if (this._canonicalAlias) {
return this._canonicalAlias; return this._canonicalAlias;
} }
if (this._aliases) { if (Array.isArray(this._aliases) && this._aliases.length !== 0) {
return this._aliases[0]; return this._aliases[0];
} }
if (this._heroes) { if (Array.isArray(this._heroes) && this._heroes.length !== 0) {
return this._heroes.join(", "); return this._heroes.join(", ");
} }
return this._roomId; return this._roomId;