fix nil struct

This commit is contained in:
Lunny Xiao 2021-06-29 11:17:03 +08:00
parent 64af3fef00
commit 1c5b27a85b
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ func (col *Column) ValueOfV(dataStruct *reflect.Value) (*reflect.Value, error) {
for _, i := range col.FieldIndex { for _, i := range col.FieldIndex {
if v.Kind() == reflect.Ptr { if v.Kind() == reflect.Ptr {
if v.IsNil() { if v.IsNil() {
return nil, nil v.Set(reflect.New(v.Type().Elem()))
} }
v = v.Elem() v = v.Elem()
} }