Skip to content

Commit

Permalink
Fix deletion events missing their previous kv due to inverted if stat…
Browse files Browse the repository at this point in the history
…ement
  • Loading branch information
NHAS committed Jan 21, 2024
1 parent 6ff547b commit ea89709
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/data/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func makeBasicEvent[T any](event *clientv3.Event) (BasicEvent[T], error) {

value := event.Kv.Value
if event.Type == clientv3.EventTypeDelete {
if event.PrevKv != nil {
if event.PrevKv == nil {
return BasicEvent[T]{}, fmt.Errorf("key was deleted and has no previous state: %s", event.Kv.Key)
}
value = event.PrevKv.Value
Expand Down

0 comments on commit ea89709

Please sign in to comment.