From 2b08b57ebf09f0d645758ede5d0aa450b052f0c5 Mon Sep 17 00:00:00 2001 From: divyam234 Date: Fri, 1 Sep 2023 13:39:27 +0530 Subject: [PATCH] check if msgId is successfully set --- services/upload.service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/upload.service.go b/services/upload.service.go index 01aa1f6..bed7285 100644 --- a/services/upload.service.go +++ b/services/upload.service.go @@ -134,6 +134,10 @@ func (us *UploadService) UploadFile(c *gin.Context) (*schemas.UploadPartOut, *ty return nil, &types.AppError{Error: err, Code: http.StatusInternalServerError} } + if msgId == 0 { + return nil, &types.AppError{Error: errors.New("failed to upload part"), Code: http.StatusInternalServerError} + } + partUpload := &models.Upload{ Name: fileName, UploadId: uploadId,