From f17cd0d5cd73501f77b1aa77d187163dd5e1e3fd Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 3 May 2022 07:18:34 -0700 Subject: [PATCH] return false if not found fix https://github.com/chrislusf/seaweedfs/issues/3011 --- weed/s3api/filer_multipart.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.go index e62d31690..32b93307a 100644 --- a/weed/s3api/filer_multipart.go +++ b/weed/s3api/filer_multipart.go @@ -178,6 +178,9 @@ func findByPartNumber(fileName string, parts []CompletedPart) (etag string, foun x := sort.Search(len(parts), func(i int) bool { return parts[i].PartNumber >= partNumber }) + if x >= len(parts) { + return + } if parts[x].PartNumber != partNumber { return }