Skip to content

Commit

Permalink
Add non-nil check to old connection in error handler (apache#1305)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Lourie <djay.il@gmail.com>
  • Loading branch information
alourie authored and Zariel committed Apr 23, 2019
1 parent 59a610c commit b99afaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion control.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ func (c *controlConn) HandleError(conn *Conn, err error, closed bool) {
}

oldConn := c.getConn()
if oldConn.conn != conn {

// If connection has long gone, and not been attempted for awhile,
// it's possible to have oldConn as nil here (#1297).
if oldConn != nil && oldConn.conn != conn {
return
}

Expand Down

0 comments on commit b99afaf

Please sign in to comment.