mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 23:25:22 +00:00
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