diff --git a/crypt/crypt.go b/crypt/crypt.go index 87a3a4694..dcd69798c 100644 --- a/crypt/crypt.go +++ b/crypt/crypt.go @@ -554,7 +554,7 @@ func (o *Object) Size() int64 { // Hash returns the selected checksum of the file // If no checksum is available it returns "" func (o *Object) Hash(hash fs.HashType) (string, error) { - return "", nil + return "", fs.ErrHashUnsupported } // UnWrap returns the wrapped Object diff --git a/fs/operations_test.go b/fs/operations_test.go index 40bb1e0d2..8384ca79b 100644 --- a/fs/operations_test.go +++ b/fs/operations_test.go @@ -1011,7 +1011,7 @@ func TestListFormat(t *testing.T) { list.SetOutput(nil) list.AddHash(test.ht) got := fs.ListFormatted(&items[0], &list) - if got != "UNSUPPORTED" { + if got != "UNSUPPORTED" && got != "" { assert.Equal(t, test.want, got) } }