From 502f43fd6c2a231bf77f83a2c31a37b38f65de84 Mon Sep 17 00:00:00 2001 From: Di Weng Date: Wed, 23 Feb 2022 16:52:26 +0800 Subject: [PATCH] create pointer if not initialized --- kusto/data/value/dynamic.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kusto/data/value/dynamic.go b/kusto/data/value/dynamic.go index b4a27ab1..e78ea389 100644 --- a/kusto/data/value/dynamic.go +++ b/kusto/data/value/dynamic.go @@ -99,6 +99,9 @@ func (d Dynamic) Convert(v reflect.Value) error { if v.Type().Kind() != reflect.Ptr { v.Set(valueToSet) } else { + if v.IsZero() { + v.Set(reflect.New(valueToSet.Type())) + } v.Elem().Set(valueToSet) } return nil