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

nil metric list panic fix #1426

Merged
merged 1 commit into from
Jun 29, 2016
Merged

nil metric list panic fix #1426

merged 1 commit into from
Jun 29, 2016

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Jun 29, 2016

Required for all PRs:

  • CHANGELOG.md updated

cc @kostasb

@@ -138,7 +138,7 @@ func (ro *RunningOutput) Write() error {
}

func (ro *RunningOutput) write(metrics []telegraf.Metric) error {
if len(metrics) == 0 {
if metrics == nil || len(metrics) == 0 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This surprises me. I think len is safe to call on nil slices.

@sparrc sparrc deleted the metrics-panic branch July 14, 2016 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants