Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #24760 to 7.x: Fix nil pointer for nil list item #24765

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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