From 9734564da2a95967b3bd3f2c02b10c9ffd15f24b Mon Sep 17 00:00:00 2001 From: ShiKhu Date: Thu, 28 Oct 2021 14:31:52 +0200 Subject: [PATCH] fix(backend-http): check nil MultipartForm --- backend/services/http/handlers_ios.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/services/http/handlers_ios.go b/backend/services/http/handlers_ios.go index 110cd2874..81ab036af 100644 --- a/backend/services/http/handlers_ios.go +++ b/backend/services/http/handlers_ios.go @@ -154,6 +154,10 @@ func iosImagesUploadHandler(w http.ResponseWriter, r *http.Request) { responseWithError(w, http.StatusInternalServerError, err) // TODO: send error here only on staging } + if (r.MultipartForm == nil) { + responseWithError(w, http.StatusInternalServerError, errors.New("Multipart not parsed")) + } + if len(r.MultipartForm.Value["projectKey"]) == 0 { responseWithError(w, http.StatusBadRequest, errors.New("projectKey parameter missing")) // status for missing/wrong parameter? return