diff --git a/app/proxyman/outbound/uot.go b/app/proxyman/outbound/uot.go index 4610bd79..f3c7426e 100644 --- a/app/proxyman/outbound/uot.go +++ b/app/proxyman/outbound/uot.go @@ -11,6 +11,9 @@ import ( ) func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) { + if dest.Address == nil { + return nil, newError("nil destination address") + } if !dest.Address.Family().IsDomain() { return nil, os.ErrInvalid } diff --git a/common/net/destination.go b/common/net/destination.go index 2d0d09ed..055395e9 100644 --- a/common/net/destination.go +++ b/common/net/destination.go @@ -113,7 +113,7 @@ func (d Destination) String() string { // IsValid returns true if this Destination is valid. func (d Destination) IsValid() bool { - return d.Address != nil && d.Network != Network_Unknown + return d.Network != Network_Unknown } // AsDestination converts current Endpoint into Destination.