diff --git a/pkg/local_object_storage/metabase/list.go b/pkg/local_object_storage/metabase/list.go index 44f25246e..74a529809 100644 --- a/pkg/local_object_storage/metabase/list.go +++ b/pkg/local_object_storage/metabase/list.go @@ -452,10 +452,11 @@ func (db *DB) CountAliveObjectsInBucket(ctx context.Context, prm CountAliveObjec return 0, ErrDegradedMode } - cidRaw := prm.BucketName[1:bucketKeySize] - if cidRaw == nil { + if len(prm.BucketName) != bucketKeySize { return 0, nil } + + cidRaw := prm.BucketName[1:bucketKeySize] var count uint64 err := db.boltDB.View(func(tx *bbolt.Tx) error { bkt := tx.Bucket(prm.BucketName)