fix: chheck that version is provided
This commit is contained in:
parent
60d8ba1ebb
commit
786d3d161f
@ -316,10 +316,15 @@ func (s *Service) PutAnswersOnePiece(c *fiber.Ctx) error {
|
||||
if len(answersStr) == 0 {
|
||||
return c.Status(fiber.StatusFailedDependency).SendString("no answers provided")
|
||||
}
|
||||
|
||||
version, err := strconv.ParseInt(form.Value["version"][0], 10, 32)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusBadRequest).SendString(fmt.Sprintf("invalid version:%s", err.Error()))
|
||||
|
||||
versionStr, ok := form.Value["version"]
|
||||
var version int64
|
||||
|
||||
if ok && len(versionStr) > 0 {
|
||||
version, err = strconv.ParseInt(versionStr[0], 10, 32)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusBadRequest).SendString(fmt.Sprintf("invalid version:%s", err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user