From 51e591877b541127d2cd51f767bd5b2b65c32909 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Thu, 21 Sep 2023 11:22:55 +0300 Subject: [PATCH] [#207] Fix list parts with empty list Signed-off-by: Marina Biryukova --- api/layer/multipart_upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/layer/multipart_upload.go b/api/layer/multipart_upload.go index c48f5387..39fe378c 100644 --- a/api/layer/multipart_upload.go +++ b/api/layer/multipart_upload.go @@ -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 }