mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
fix crash when state is not set (erroneously?) on gap response
this seems to happen when the only event in the room is a m.room.create
This commit is contained in:
parent
34ec96c1b8
commit
1fe496eeea
@ -142,8 +142,9 @@ export class GapWriter {
|
||||
return RoomMember.fromReplacingMemberEvent(this._roomId, event)?.serialize();
|
||||
}
|
||||
}
|
||||
// assuming the member hasn't changed within the chunk, just take it from state if it's there
|
||||
const stateMemberEvent = state.find(isOurUser);
|
||||
// assuming the member hasn't changed within the chunk, just take it from state if it's there.
|
||||
// Don't assume state is set though, as it can be empty at the top of the timeline in some circumstances
|
||||
const stateMemberEvent = state?.find(isOurUser);
|
||||
if (stateMemberEvent) {
|
||||
return RoomMember.fromMemberEvent(this._roomId, stateMemberEvent)?.serialize();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user