Skip to content

Commit

Permalink
[Ingest Manager] Fix nil pointer for nil list item (#24760)
Browse files Browse the repository at this point in the history
[Ingest Manager] Fix nil pointer for nil list item (#24760)
  • Loading branch information
michalpristas committed Mar 25, 2021
1 parent 234dba4 commit 531e5c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ inputs:
use_output: default
streams:
- metricset: status
processors:
- null
data_stream:
dataset: docker.status
- metricset: info
Expand Down
7 changes: 7 additions & 0 deletions x-pack/elastic-agent/pkg/agent/transpiler/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 531e5c3

Please sign in to comment.