1
0
mirror of https://github.com/rancher/norman.git synced 2025-07-05 03:27:37 +00:00

Merge pull request #245 from alena1108/jan29

MinLength verification bug fix
This commit is contained in:
Darren Shepherd 2019-01-29 14:57:22 -07:00 committed by GitHub
commit 196df5ed9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,7 @@ func CheckFieldCriteria(fieldName string, field types.Field, value interface{})
} }
} }
if hasStrVal { if hasStrVal || value == "" {
if field.MinLength != nil && int64(len(strVal)) < *field.MinLength { if field.MinLength != nil && int64(len(strVal)) < *field.MinLength {
return httperror.NewFieldAPIError(httperror.MinLengthExceeded, fieldName, "") return httperror.NewFieldAPIError(httperror.MinLengthExceeded, fieldName, "")
} }