metabase: Check parameter for CountAliveObjectsInBucket #1414

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/count-in-bucket into master 2024-10-04 14:52:05 +00:00

View file

@ -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)