Skip to content

Commit

Permalink
fix: check for nil client before closing in amqp (#10635)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c4df85)
  • Loading branch information
powersj committed Feb 16, 2022
1 parent 2db8013 commit 7c81f59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/outputs/amqp/amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (q *AMQP) Write(metrics []telegraf.Metric) error {
if err != nil {
return err
}
} else {
} else if q.client != nil {
if err := q.client.Close(); err != nil {
q.Log.Errorf("Closing connection failed: %v", err)
}
Expand Down

0 comments on commit 7c81f59

Please sign in to comment.