Skip to content

Commit 18d3bc8

Browse files
StolexiyOleksiy Stepaniuk
andauthored
fix - panic: interface conversion: interface {} is nil, not string (#49)
Co-authored-by: Oleksiy Stepaniuk <[email protected]>
1 parent e080b28 commit 18d3bc8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

conversion.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ func convertFromDynamicToStaticValue(staticType reflect.Type, dynamicValue inter
125125
t, _ := time.Parse(format, dynamicValue.(string))
126126
staticValue = NewTime(t)
127127
case "Many2One":
128-
staticValue = NewMany2One(dynamicValue.([]interface{})[0].(int64), dynamicValue.([]interface{})[1].(string))
128+
name, _ := dynamicValue.([]interface{})[1].(string)
129+
staticValue = NewMany2One(dynamicValue.([]interface{})[0].(int64), name)
129130
case "Relation":
130131
staticValue = NewRelation()
131132
staticValue.(*Relation).ids = sliceInterfaceToInt64Slice(dynamicValue.([]interface{}))

0 commit comments

Comments
 (0)