Macaron: Continue on invalid slice type to avoid panic (#39004)

Makes the panic go away.
Otherwise I get a reflect: call of reflect.Value.Interface on zero Value
This commit is contained in:
Kyle Brandt
2021-09-09 10:32:18 -04:00
committed by GitHub
parent 6e667cacee
commit fb14769383
+4
View File
@@ -419,6 +419,10 @@ func validateField(errors Errors, zero interface{}, field reflect.StructField, f
sliceVal = sliceVal.Elem()
}
if sliceVal.Kind() == reflect.Invalid {
continue
}
sliceValue := sliceVal.Interface()
zero := reflect.Zero(sliceVal.Type()).Interface()
if sliceVal.Kind() == reflect.Struct ||