diff --git a/objstore.go b/objstore.go index 116538ca..5bce3ef6 100644 --- a/objstore.go +++ b/objstore.go @@ -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() }