fix: wireguard handle conn is nil

This commit is contained in:
gVisor bot 2022-11-18 19:32:12 +08:00
parent d57e07d611
commit e9333f4586

View file

@ -216,6 +216,9 @@ func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, opts
if err != nil { if err != nil {
return nil, err return nil, err
} }
if conn == nil {
return nil, E.New("conn is nil")
}
return NewConn(&wgConn{conn, w}, w), nil return NewConn(&wgConn{conn, w}, w), nil
} }