Fix panic in redaction handling
This commit is contained in:
parent
d1d129f6cf
commit
c6ca343cd1
@ -123,7 +123,7 @@ func (hm *HistoryManager) Update(room *rooms.Room, eventID string, update func(e
|
|||||||
}
|
}
|
||||||
stream := tx.Bucket(bucketRoomStreams).Bucket(rid)
|
stream := tx.Bucket(bucketRoomStreams).Bucket(rid)
|
||||||
eventData := stream.Get(streamIndex)
|
eventData := stream.Get(streamIndex)
|
||||||
if eventData == nil {
|
if eventData == nil || len(eventData) == 0 {
|
||||||
return EventNotFoundError
|
return EventNotFoundError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ func (c *Container) HandleRedaction(source EventSource, evt *mautrix.Event) {
|
|||||||
debug.Print("Failed to mark", evt.Redacts, "as redacted:", err)
|
debug.Print("Failed to mark", evt.Redacts, "as redacted:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !room.Loaded() {
|
if !room.Loaded() || redactedEvt == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user