From eb090d3544cb755ed8bc30a401ceff69671546e7 Mon Sep 17 00:00:00 2001 From: buengese Date: Wed, 20 Jan 2021 17:07:03 +0100 Subject: [PATCH] compress: check type assertion in SetTier - fixes #4941 --- backend/compress/compress.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/compress/compress.go b/backend/compress/compress.go index ae12b4917..96ee53811 100644 --- a/backend/compress/compress.go +++ b/backend/compress/compress.go @@ -1225,8 +1225,8 @@ func (o *Object) Hash(ctx context.Context, ht hash.Type) (string, error) { // multiple storage classes supported func (o *Object) SetTier(tier string) error { do, ok := o.Object.(fs.SetTierer) - mdo, ok := o.mo.(fs.SetTierer) - if !ok { + mdo, mok := o.mo.(fs.SetTierer) + if !(ok && mok) { return errors.New("press: underlying remote does not support SetTier") } if err := mdo.SetTier(tier); err != nil {