From 3f5afabd4a16f1e1fd0f421ef38d5c6e47e44677 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Tue, 7 Jun 2022 16:33:23 +0400 Subject: [PATCH] [#515] Fix nil reference when a part is missing Signed-off-by: Angira Kekteeva --- 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 d87af839c..6ebfe4e16 100644 --- a/api/layer/multipart_upload.go +++ b/api/layer/multipart_upload.go @@ -340,7 +340,7 @@ func (n *layer) CompleteMultipartUpload(ctx context.Context, p *CompleteMultipar var completedPartsHeader strings.Builder for i, part := range p.Parts { partInfo := partsInfo[part.PartNumber] - if part.ETag != partInfo.ETag { + if partInfo == nil || part.ETag != partInfo.ETag { return nil, nil, errors.GetAPIError(errors.ErrInvalidPart) } // for the last part we have no minimum size limit