Skip to content

Commit

Permalink
Fix crash in Docker input plugin - Fixes #1195
Browse files Browse the repository at this point in the history
Commit fixes crash in Docker input plugin caused by the fact that return value
might be nil when error occurs.

closes #1195
  • Loading branch information
zstyblik authored and sparrc committed May 18, 2016
1 parent 08ecfb8 commit 39df263
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Bugfixes

- [#1195](https://github.com/influxdata/telegraf/pull/1195): Docker panic on timeout. Thanks @zstyblik!

## v0.13 [2016-05-11]

### Release Notes
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (d *Docker) gatherContainer(
defer cancel()
r, err := d.client.ContainerStats(ctx, container.ID, false)
if err != nil {
log.Printf("Error getting docker stats: %s\n", err.Error())
return fmt.Errorf("Error getting docker stats: %s", err.Error())
}
defer r.Close()
dec := json.NewDecoder(r)
Expand Down

0 comments on commit 39df263

Please sign in to comment.