Skip to content

Commit

Permalink
return err if Size is not set
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwanth Goli <[email protected]>
  • Loading branch information
ashwanthgoli committed Oct 10, 2024
1 parent b7187b0 commit 512cd52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,5 +837,9 @@ type ObjectSizerReadCloser struct {

// ObjectSize implement ObjectSizer.
func (o ObjectSizerReadCloser) ObjectSize() (int64, error) {
if o.Size == nil {
return 0, errors.New("unknown size")
}

return o.Size()
}

0 comments on commit 512cd52

Please sign in to comment.