From 524c1524e54bad755850b949b01c2117c74b98f0 Mon Sep 17 00:00:00 2001 From: vjeffrey Date: Thu, 21 Sep 2023 00:00:36 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=201720:=20error=20in=20dns?= =?UTF-8?q?=20fields=20parsing=20(#1820)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes https://github.com/mondoohq/cnquery/issues/1720 --- providers/network/resources/dns.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/providers/network/resources/dns.go b/providers/network/resources/dns.go index d035d6ffa5..58c5abdc92 100644 --- a/providers/network/resources/dns.go +++ b/providers/network/resources/dns.go @@ -100,12 +100,18 @@ func (d *mqlDns) records(params interface{}) ([]interface{}, error) { continue } + var ttl *llx.RawData + if r["TTL"] == nil { + ttl = llx.NilData + } else { + ttl = llx.IntData(r["TTL"].(int64)) + } o, err := CreateResource(d.MqlRuntime, "dns.record", map[string]*llx.RawData{ "name": llx.StringData(r["name"].(string)), - "ttl": llx.IntData(r["TTL"].(int64)), + "ttl": ttl, "class": llx.StringData(r["class"].(string)), "type": llx.StringData(r["type"].(string)), - "rdata": llx.ArrayData(llx.TArr2Raw(r["rData"].([]string)), types.String), + "rdata": llx.ArrayData(llx.TArr2Raw(r["rData"].([]interface{})), types.String), }) if err != nil { return nil, err