kafka panic: Check that error is non-nil before

fixes #1764
This commit is contained in:
Cameron Sparr 2016-09-14 08:52:58 +01:00
parent bc22309459
commit 9b2e2cc41f
2 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,7 @@
- [#1733](https://github.com/influxdata/telegraf/issues/1733): Fix statsd scientific notation parsing - [#1733](https://github.com/influxdata/telegraf/issues/1733): Fix statsd scientific notation parsing
- [#1716](https://github.com/influxdata/telegraf/issues/1716): Sensors plugin strconv.ParseFloat: parsing "": invalid syntax - [#1716](https://github.com/influxdata/telegraf/issues/1716): Sensors plugin strconv.ParseFloat: parsing "": invalid syntax
- [#1530](https://github.com/influxdata/telegraf/issues/1530): Fix prometheus_client reload panic - [#1530](https://github.com/influxdata/telegraf/issues/1530): Fix prometheus_client reload panic
- [#1764](https://github.com/influxdata/telegraf/issues/1764): Fix kafka consumer panic when nil error is returned down errs channel.
## v1.0 [2016-09-08] ## v1.0 [2016-09-08]

View File

@ -128,7 +128,9 @@ func (k *Kafka) receiver() {
case <-k.done: case <-k.done:
return return
case err := <-k.errs: case err := <-k.errs:
log.Printf("Kafka Consumer Error: %s\n", err.Error()) if err != nil {
log.Printf("Kafka Consumer Error: %s\n", err)
}
case msg := <-k.in: case msg := <-k.in:
metrics, err := k.parser.Parse(msg.Value) metrics, err := k.parser.Parse(msg.Value)
if err != nil { if err != nil {