From 949a74edfa1847b623cb7cc0781bb55529f5d6ab Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 17 Feb 2017 10:33:42 +0100 Subject: [PATCH] fix a nil reference issue in tls listener --- transport/internet/tcp/hub.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/internet/tcp/hub.go b/transport/internet/tcp/hub.go index 80339d4c9..df6cd83df 100644 --- a/transport/internet/tcp/hub.go +++ b/transport/internet/tcp/hub.go @@ -107,12 +107,13 @@ func (v *TCPListener) KeepAccepting() { v.Unlock() break } - if v.tlsConfig != nil { + if conn != nil && v.tlsConfig != nil { conn = tls.Server(conn, v.tlsConfig) } - if v.authConfig != nil { + if conn != nil && v.authConfig != nil { conn = v.authConfig.Server(conn) } + select { case v.awaitingConns <- &ConnectionWithError{ conn: conn,