[#207] Fix list parts with empty list

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
Marina Biryukova 2023-09-21 11:22:55 +03:00
parent a4c612614a
commit 51e591877b

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
}