From 8a55778c322b9672a88cf08f3b974913e1d85724 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 22 Nov 2019 09:29:18 +0100 Subject: [PATCH] make sure aliases and heroes aren't empty when picking name --- package.json | 2 +- src/matrix/room/summary.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 57e868bb..b0706552 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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", "main": "index.js", "directories": { diff --git a/src/matrix/room/summary.js b/src/matrix/room/summary.js index c268e7e9..614b494d 100644 --- a/src/matrix/room/summary.js +++ b/src/matrix/room/summary.js @@ -26,10 +26,10 @@ export default class RoomSummary { if (this._canonicalAlias) { return this._canonicalAlias; } - if (this._aliases) { + if (Array.isArray(this._aliases) && this._aliases.length !== 0) { return this._aliases[0]; } - if (this._heroes) { + if (Array.isArray(this._heroes) && this._heroes.length !== 0) { return this._heroes.join(", "); } return this._roomId;