mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Try to fix a panic in the sync API PDU stream
This commit is contained in:
parent
7bd6631935
commit
0b21cb78aa
1 changed files with 6 additions and 2 deletions
|
@ -321,10 +321,14 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse(
|
|||
)
|
||||
|
||||
if len(delta.StateEvents) > 0 {
|
||||
updateLatestPosition(delta.StateEvents[len(delta.StateEvents)-1].EventID())
|
||||
if last := delta.StateEvents[len(delta.StateEvents)-1]; last != nil {
|
||||
updateLatestPosition(last.EventID())
|
||||
}
|
||||
}
|
||||
if len(events) > 0 {
|
||||
updateLatestPosition(events[len(events)-1].EventID())
|
||||
if last := events[len(events)-1]; last != nil {
|
||||
updateLatestPosition(last.EventID())
|
||||
}
|
||||
}
|
||||
|
||||
switch delta.Membership {
|
||||
|
|
Loading…
Reference in a new issue