From 3643f856a3edeaa4db7ede87a4bc2928d2aadc09 Mon Sep 17 00:00:00 2001 From: aelmel <5629597+aelmel@users.noreply.github.com> Date: Sun, 24 Apr 2022 04:10:36 +0300 Subject: [PATCH] check for pointer to pointer value (#5278) * check for pointer to pointer value * revert to Ptr Co-authored-by: Alexei Melnic --- schema/field.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/schema/field.go b/schema/field.go index fd8b2e6a..d6df6596 100644 --- a/schema/field.go +++ b/schema/field.go @@ -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) {