1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-03 08:14:40 +00:00

MinLength verification bug fix

This commit is contained in:
Alena Prokharchyk
2019-01-29 13:55:47 -08:00
parent fe50543a2e
commit cf3f1e303f

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 {
return httperror.NewFieldAPIError(httperror.MinLengthExceeded, fieldName, "")
}