mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Some guards
This commit is contained in:
parent
c4c2c9d0ff
commit
3f9617e373
|
|
@ -52,8 +52,9 @@ func NewRistrettoCache(maxCost CacheSize, enablePrometheus bool) (*Caches, error
|
|||
Name: "room_ids",
|
||||
},
|
||||
RoomServerEvents: &RistrettoCachePartition[int64, *gomatrixserverlib.Event]{
|
||||
cache: cache,
|
||||
Name: "room_events",
|
||||
cache: cache,
|
||||
Name: "room_events",
|
||||
Mutable: true,
|
||||
},
|
||||
RoomInfos: &RistrettoCachePartition[string, types.RoomInfo]{
|
||||
cache: cache,
|
||||
|
|
|
|||
|
|
@ -493,7 +493,9 @@ func (d *Database) events(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
d.Cache.StoreRoomServerEvent(result.EventNID, result.Event)
|
||||
if result.Event != nil {
|
||||
d.Cache.StoreRoomServerEvent(result.EventNID, result.Event)
|
||||
}
|
||||
}
|
||||
if !redactionsArePermanent {
|
||||
d.applyRedactions(results)
|
||||
|
|
|
|||
Loading…
Reference in a new issue