Skip to content

Commit

Permalink
fix: contextWatchDog nil pointer check (#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain authored Dec 27, 2023
1 parent 4c4b0cb commit f96594f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conn_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func (b *batch) Send() (err error) {
stopCW := contextWatchdog(b.ctx, func() {
// close TCP connection on context cancel. There is no other way simple way to interrupt underlying operations.
// as verified in the test, this is safe to do and cleanups resources later on
_ = b.conn.conn.Close()
if b.conn != nil {
_ = b.conn.conn.Close()
}
})

defer func() {
Expand Down

0 comments on commit f96594f

Please sign in to comment.