From dfc0ec995c93ed8c80de4071a722b96e1a2f23ca Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Fri, 18 Nov 2022 19:32:12 +0800 Subject: [PATCH] fix: wireguard handle conn is nil --- adapter/outbound/wireguard.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapter/outbound/wireguard.go b/adapter/outbound/wireguard.go index eb48c0c0..33a0f44a 100644 --- a/adapter/outbound/wireguard.go +++ b/adapter/outbound/wireguard.go @@ -216,6 +216,9 @@ func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, opts if err != nil { return nil, err } + if conn == nil { + return nil, E.New("conn is nil") + } return NewConn(&wgConn{conn, w}, w), nil }