From 7b2fa2c93ddc5646ca359848b60638a758a37625 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 6 Dec 2024 12:43:46 +0200 Subject: [PATCH] refactor: simplify error handling for multipart form reading --- huma.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/huma.go b/huma.go index 81bc78c9..99063935 100644 --- a/huma.go +++ b/huma.go @@ -1245,7 +1245,7 @@ func Register[I, O any](api API, op Operation, handler func(context.Context, *I) if rawBodyMultipart || rawBodyDecodedMultipart { form, err := ctx.GetMultipartForm() - if err != nil || form == nil { + if err != nil { res.Errors = append(res.Errors, &ErrorDetail{ Location: "body", Message: "cannot read multipart form: " + err.Error(),