From 5a8aac57ac0487fb915801fc6e53d5cce838dc1f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 8 Sep 2020 15:00:20 +0200 Subject: [PATCH] there might not be a member yet --- src/matrix/room/timeline/persistence/SyncWriter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/room/timeline/persistence/SyncWriter.js b/src/matrix/room/timeline/persistence/SyncWriter.js index 0d9bea9d..d265782f 100644 --- a/src/matrix/room/timeline/persistence/SyncWriter.js +++ b/src/matrix/room/timeline/persistence/SyncWriter.js @@ -107,7 +107,7 @@ export class SyncWriter { if (trackNewlyJoined) { const existingMemberData = await txn.roomMembers.get(this._roomId, userId); // mark new members so we know who needs our the room key for our outbound megolm session - member.needsRoomKey = existingMemberData.needsRoomKey || memberChange.hasJoined; + member.needsRoomKey = existingMemberData?.needsRoomKey || memberChange.hasJoined; } txn.roomMembers.set(member.serialize()); return memberChange;