diff --git a/x-pack/elastic-agent/CHANGELOG.next.asciidoc b/x-pack/elastic-agent/CHANGELOG.next.asciidoc index 95da4d2107a4..a132be48eab2 100644 --- a/x-pack/elastic-agent/CHANGELOG.next.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.next.asciidoc @@ -44,6 +44,7 @@ - Fix docker enrollment issue related to Fleet Server change. {pull}24155[24155] - Improve log on failure of Endpoint Security installation. {pull}24429[24429] - Verify communication to Kibana before updating Fleet client. {pull}24489[24489] +- Fix nil pointer when null is generated as list item. {issue}23734[23734] ==== New features diff --git a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml index fb585dae996f..006db1e9f524 100644 --- a/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml +++ b/x-pack/elastic-agent/pkg/agent/program/testdata/single_config.yml @@ -40,6 +40,8 @@ inputs: use_output: default streams: - metricset: status + processors: + - null data_stream: dataset: docker.status - metricset: info diff --git a/x-pack/elastic-agent/pkg/agent/transpiler/ast.go b/x-pack/elastic-agent/pkg/agent/transpiler/ast.go index cfb02d1660ac..1ae1066c8c6e 100644 --- a/x-pack/elastic-agent/pkg/agent/transpiler/ast.go +++ b/x-pack/elastic-agent/pkg/agent/transpiler/ast.go @@ -126,7 +126,11 @@ func (d *Dict) Value() interface{} { func (d *Dict) Clone() Node { nodes := make([]Node, 0, len(d.value)) for _, i := range d.value { + if i == nil { + continue + } nodes = append(nodes, i.Clone()) + } return &Dict{value: nodes} } @@ -350,6 +354,9 @@ func (l *List) Value() interface{} { func (l *List) Clone() Node { nodes := make([]Node, 0, len(l.value)) for _, i := range l.value { + if i == nil { + continue + } nodes = append(nodes, i.Clone()) } return &List{value: nodes}