Skip to content

Commit

Permalink
Avoid a nil pointer
Browse files Browse the repository at this point in the history
With many MaxInFlight, we attempted to close the connection
even after it was closed and nil.

It's a hacky fix but this whole area will be redesigned
  • Loading branch information
mkuratczyk committed Nov 25, 2024
1 parent 49af267 commit 5ef4044
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/amqp10_client/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,7 @@ func (p *Amqp10Publisher) Send() error {

func (p *Amqp10Publisher) Stop(reason string) {
log.Debug("closing connection", "id", p.Id, "reason", reason)
_ = p.Connection.Close()
if p.Connection != nil {
_ = p.Connection.Close()
}
}

0 comments on commit 5ef4044

Please sign in to comment.