diff --git a/pkg/network/tcp_transport.go b/pkg/network/tcp_transport.go index a9b6feb3b..8195ca039 100644 --- a/pkg/network/tcp_transport.go +++ b/pkg/network/tcp_transport.go @@ -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.