[#207] Fix list parts with empty list #214

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:bugfix/list_parts_empty_list into support/v0.28 2023-09-21 14:48:22 +00:00

View file

@ -548,7 +548,7 @@ func (n *layer) ListParts(ctx context.Context, p *ListPartsParams) (*ListPartsIn
return parts[i].PartNumber < parts[j].PartNumber
})
if p.PartNumberMarker >= parts[len(parts)-1].PartNumber {
if len(parts) == 0 || p.PartNumberMarker >= parts[len(parts)-1].PartNumber {
res.Parts = make([]*Part, 0)
return &res, nil
}