Skip to content

Commit d7383af

Browse files
author
keimoon
committed
Fix potential panic in conn.Close
1 parent f3a4d0e commit d7383af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (c *Conn) Close() error {
7070
c.mutex.Lock()
7171
defer c.mutex.Unlock()
7272
c.isClosed = true
73-
if c.state == connStateNotConnected {
73+
if c.state == connStateNotConnected || c.tcpConn == nil {
7474
return nil
7575
}
7676
c.state = connStateNotConnected

0 commit comments

Comments
 (0)