fix: wireguard handle conn is nil

This commit is contained in:
wwqgtxx 2022-11-18 19:32:12 +08:00
parent 8b848b62bb
commit dfc0ec995c

View file

@ -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
}