Skip to content

Commit

Permalink
check for pointer to pointer value (#5278)
Browse files Browse the repository at this point in the history
* check for pointer to pointer value

* revert to Ptr

Co-authored-by: Alexei Melnic <alexei.melnic@meliora.xyz>
  • Loading branch information
aelmel and Alexei Melnic committed Apr 24, 2022
1 parent 9b80fe9 commit 3643f85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions schema/field.go
Expand Up @@ -528,6 +528,9 @@ func (field *Field) setupValuerAndSetter() {
reflectValType := reflectV.Type()

if reflectValType.AssignableTo(field.FieldType) {
if reflectV.Kind() == reflect.Ptr && reflectV.Elem().Kind() == reflect.Ptr {
reflectV = reflect.Indirect(reflectV)
}
field.ReflectValueOf(ctx, value).Set(reflectV)
return
} else if reflectValType.ConvertibleTo(field.FieldType) {
Expand Down

0 comments on commit 3643f85

Please sign in to comment.