[#207] Fix list parts with empty list
All checks were successful
/ DCO (pull_request) Successful in 1m2s
/ Vulncheck (pull_request) Successful in 1m25s
/ Builds (1.20) (pull_request) Successful in 1m59s
/ Builds (1.21) (pull_request) Successful in 1m52s
/ Lint (pull_request) Successful in 8m23s
/ Tests (1.20) (pull_request) Successful in 2m1s
/ Tests (1.21) (pull_request) Successful in 9m26s
All checks were successful
/ DCO (pull_request) Successful in 1m2s
/ Vulncheck (pull_request) Successful in 1m25s
/ Builds (1.20) (pull_request) Successful in 1m59s
/ Builds (1.21) (pull_request) Successful in 1m52s
/ Lint (pull_request) Successful in 8m23s
/ Tests (1.20) (pull_request) Successful in 2m1s
/ Tests (1.21) (pull_request) Successful in 9m26s
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
a4c612614a
commit
51e591877b
1 changed files with 1 additions and 1 deletions
|
@ -548,7 +548,7 @@ func (n *layer) ListParts(ctx context.Context, p *ListPartsParams) (*ListPartsIn
|
||||||
return parts[i].PartNumber < parts[j].PartNumber
|
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)
|
res.Parts = make([]*Part, 0)
|
||||||
return &res, nil
|
return &res, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue