From 2345148fde9da5ade40749d359bf915ef847a4cd Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 27 Aug 2020 10:13:47 -0700 Subject: [PATCH] make sure conn is not nil --- src/croc/croc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/croc/croc.go b/src/croc/croc.go index 45a6a13b9..459c90ec7 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -369,6 +369,9 @@ func (c *Client) Send(options TransferOptions) (err error) { } log.Debugf("could not establish '%s'", address) } + if conn == nil && err == nil { + err = fmt.Errorf("could not connect") + } if err != nil { err = fmt.Errorf("could not connect to %s: %w", c.Options.RelayAddress, err) log.Debug(err)