Skip to content

Commit

Permalink
fix - panic: interface conversion: interface {} is nil, not string (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksiy Stepaniuk <[email protected]>
  • Loading branch information
Stolexiy and Oleksiy Stepaniuk authored Feb 15, 2024
1 parent e080b28 commit 18d3bc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ func convertFromDynamicToStaticValue(staticType reflect.Type, dynamicValue inter
t, _ := time.Parse(format, dynamicValue.(string))
staticValue = NewTime(t)
case "Many2One":
staticValue = NewMany2One(dynamicValue.([]interface{})[0].(int64), dynamicValue.([]interface{})[1].(string))
name, _ := dynamicValue.([]interface{})[1].(string)
staticValue = NewMany2One(dynamicValue.([]interface{})[0].(int64), name)
case "Relation":
staticValue = NewRelation()
staticValue.(*Relation).ids = sliceInterfaceToInt64Slice(dynamicValue.([]interface{}))
Expand Down

0 comments on commit 18d3bc8

Please sign in to comment.