mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 18:33:49 +01:00
Fix nil pointer access when redacting events (#2560)
This commit is contained in:
parent
460dccf93d
commit
f3e8a9a4cb
1 changed files with 3 additions and 0 deletions
|
@ -834,6 +834,9 @@ func (d *Database) handleRedactions(
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", fmt.Errorf("d.GetStateEvent: %w", err)
|
return nil, "", fmt.Errorf("d.GetStateEvent: %w", err)
|
||||||
}
|
}
|
||||||
|
if powerLevels == nil {
|
||||||
|
return nil, "", fmt.Errorf("unable to fetch m.room.power_levels event from database for room %s", event.RoomID())
|
||||||
|
}
|
||||||
pl, err := powerLevels.PowerLevels()
|
pl, err := powerLevels.PowerLevels()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", fmt.Errorf("unable to get powerlevels for room: %w", err)
|
return nil, "", fmt.Errorf("unable to get powerlevels for room: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue