Skip to content

Commit

Permalink
🐛 fix 1720: error in dns fields parsing (#1820)
Browse files Browse the repository at this point in the history
fixes #1720
  • Loading branch information
vjeffrey authored Sep 21, 2023
1 parent ebe8c80 commit 524c152
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions providers/network/resources/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 524c152

Please sign in to comment.