From ad453555b9e0ed73b33afb26616a09503645d33f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 17 Jul 2021 13:23:13 -0700 Subject: [PATCH 1/2] Avoid storing null for invite avatars. --- src/matrix/room/Invite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/room/Invite.js b/src/matrix/room/Invite.js index ce400f01..86f9dcaa 100644 --- a/src/matrix/room/Invite.js +++ b/src/matrix/room/Invite.js @@ -180,7 +180,7 @@ export class Invite extends EventEmitter { _createData(inviteState, myInvite, inviter, summaryData, heroes) { const name = heroes ? heroes.roomName : summaryData.name; const avatarUrl = heroes ? heroes.roomAvatarUrl : summaryData.avatarUrl; - const avatarColorId = heroes ? heroes.roomAvatarColorId : this.id; + const avatarColorId = heroes?.roomAvatarColorId || this.id; return { roomId: this.id, isEncrypted: !!summaryData.encryption, From c9e937c41c97929375e8f535e6e3235fe9b85496 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 17 Jul 2021 13:29:20 -0700 Subject: [PATCH 2/2] Add redundancy to prevent stored nulls from causing errors. --- src/matrix/room/Invite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/room/Invite.js b/src/matrix/room/Invite.js index 86f9dcaa..9bf818ae 100644 --- a/src/matrix/room/Invite.js +++ b/src/matrix/room/Invite.js @@ -58,7 +58,7 @@ export class Invite extends EventEmitter { /** @see BaseRoom.avatarColorId */ get avatarColorId() { - return this._inviteData.avatarColorId; + return this._inviteData.avatarColorId || this.id; } get timestamp() {