From c7182ad6afbe1e239133116a97b65a1262abd9eb Mon Sep 17 00:00:00 2001 From: Adam Fisk Date: Wed, 6 Nov 2024 09:44:06 -0700 Subject: [PATCH] added nil check --- fronted.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fronted.go b/fronted.go index 936a336..e617386 100644 --- a/fronted.go +++ b/fronted.go @@ -376,7 +376,9 @@ func (f *fronted) doDial(m MasqueradeInterface) (conn net.Conn, retriable bool, // Log the time it takes to dial defer func(start time.Time) { - log.Debugf("Dialing to %v took %v", m, time.Since(start)) + if conn != nil { + log.Debugf("Dialing to %v took %v", m, time.Since(start)) + } }(time.Now()) conn, err = m.dial(f.certPool, f.clientHelloID) if err != nil {