there might not be a member yet

This commit is contained in:
Bruno Windels 2020-09-08 15:00:20 +02:00
parent 7bba83aa9e
commit 5a8aac57ac

View file

@ -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;