Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for nil client before closing in amqp (#10635)
Browse files Browse the repository at this point in the history
powersj authored and MyaLongmire committed Jul 6, 2022
1 parent 76c14de commit 97f471f
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
@@ -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)
}

0 comments on commit 97f471f

Please sign in to comment.