Skip to content

Commit

Permalink
fix: handle nil compaction response
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <[email protected]>
  • Loading branch information
TylerGillson committed Mar 12, 2024
1 parent a9d2c9c commit 074e33a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ func (c *client) Delete(ctx context.Context, key string, revision int64) error {

func (c *client) Compact(ctx context.Context, revision int64) (int64, error) {
resp, err := c.c.Compact(ctx, revision)
return resp.Header.GetRevision(), err
if resp != nil {
return resp.Header.GetRevision(), err
}
return 0, err
}

func (c *client) Close() error {
Expand Down

0 comments on commit 074e33a

Please sign in to comment.