forked from TrueCloudLab/neoneo-go
Merge pull request #721 from nspcc-dev/fix-panic-in-tcptransport-close
network: add a nil check in (*TCPTransport).Close, prevent panic
This commit is contained in:
commit
44c392450a
1 changed files with 3 additions and 1 deletions
|
@ -75,7 +75,9 @@ func (t *TCPTransport) isCloseError(err error) bool {
|
|||
|
||||
// Close implements the Transporter interface.
|
||||
func (t *TCPTransport) Close() {
|
||||
t.listener.Close()
|
||||
if t.listener != nil {
|
||||
t.listener.Close()
|
||||
}
|
||||
}
|
||||
|
||||
// Proto implements the Transporter interface.
|
||||
|
|
Loading…
Reference in a new issue