fix: npe
This commit is contained in:
parent
d6df026550
commit
2044458df9
@ -149,10 +149,12 @@ func (c *conn) AppendToChains(a C.ProxyAdapter) {
|
|||||||
|
|
||||||
func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn {
|
func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn {
|
||||||
var remoteDestination string
|
var remoteDestination string
|
||||||
if tcpAddr, ok := c.RemoteAddr().(*net.TCPAddr); ok {
|
if c != nil {
|
||||||
remoteDestination = tcpAddr.IP.String()
|
if tcpAddr, ok := c.RemoteAddr().(*net.TCPAddr); ok {
|
||||||
} else {
|
remoteDestination = tcpAddr.IP.String()
|
||||||
remoteDestination = parseRemoteDestination(a.Addr())
|
} else {
|
||||||
|
remoteDestination = parseRemoteDestination(a.Addr())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &conn{c, []string{a.Name()}, remoteDestination}
|
return &conn{c, []string{a.Name()}, remoteDestination}
|
||||||
|
Reference in New Issue
Block a user