From 18d3bc8b270f92c985d25b23b5687eb968cde0d3 Mon Sep 17 00:00:00 2001 From: Oleksiy Stepaniuk Date: Thu, 15 Feb 2024 11:05:01 +0200 Subject: [PATCH] fix - panic: interface conversion: interface {} is nil, not string (#49) Co-authored-by: Oleksiy Stepaniuk --- conversion.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conversion.go b/conversion.go index 84571b11..a55d4b62 100644 --- a/conversion.go +++ b/conversion.go @@ -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{}))