From a13dedb6e4d01907ed6164e9d161fe7ad32eeebd Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Fri, 25 Nov 2022 12:10:33 +0800 Subject: [PATCH] fix: tuic panic --- transport/tuic/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transport/tuic/client.go b/transport/tuic/client.go index b6bb0bf7..eaa981ab 100644 --- a/transport/tuic/client.go +++ b/transport/tuic/client.go @@ -241,6 +241,9 @@ func (t *Client) DialContext(ctx context.Context, metadata *C.Metadata, dialFn f } return stream, err }() + if err != nil { + return nil, err + } if t.RequestTimeout > 0 { _ = stream.SetReadDeadline(time.Now().Add(time.Duration(t.RequestTimeout) * time.Millisecond))