diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 5d15e80c6..b91e168c2 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -960,7 +960,10 @@ func HashLister(ht hash.Type, f fs.Fs, w io.Writer) error { func Count(f fs.Fs) (objects int64, size int64, err error) { err = ListFn(f, func(o fs.Object) { atomic.AddInt64(&objects, 1) - atomic.AddInt64(&size, o.Size()) + objectSize := o.Size() + if objectSize > 0 { + atomic.AddInt64(&size, objectSize) + } }) return }