Skip to content

Commit

Permalink
handle nil io.ReadCloser
Browse files Browse the repository at this point in the history
  • Loading branch information
dmwilson-grafana committed Feb 19, 2025
1 parent af4d53e commit b9d512c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/storegateway/indexheader/binary_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ func WriteBinary(ctx context.Context, bkt objstore.BucketReader, id ulid.ULID, f

merr := multierror.MultiError{}
defer func() {
merr.Add(errors.Wrapf(sym.Close(), "close symbol reader"))
merr.Add(errors.Wrapf(tbl.Close(), "close posting offsets reader"))
if sym != nil {
merr.Add(errors.Wrapf(sym.Close(), "close symbol reader"))
}
if tbl != nil {
merr.Add(errors.Wrapf(tbl.Close(), "close posting offsets reader"))
}
}()

// wait until both GetRange requets have completed before writing bytes
Expand Down

0 comments on commit b9d512c

Please sign in to comment.