Be more specific

This commit is contained in:
Neil Alexander 2022-06-15 10:10:04 +01:00
parent ba8e1607e2
commit 9b2dc10254
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -501,11 +501,15 @@ func (d *Database) events(
if !ok { if !ok {
panic("should have position") panic("should have position")
} }
delete(positions, result.EventNID)
results[pos] = result results[pos] = result
if result.Event != nil { if result.Event != nil {
d.Cache.StoreRoomServerEvent(result.EventNID, result.Event) d.Cache.StoreRoomServerEvent(result.EventNID, result.Event)
} }
} }
if len(positions) > 0 {
panic("unsatisfied events")
}
if !redactionsArePermanent { if !redactionsArePermanent {
d.applyRedactions(results) d.applyRedactions(results)
} }