0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

make sure conn is not nil

This commit is contained in:
Zack Scholl 2020-08-27 10:13:47 -07:00
parent 50bf003022
commit 2345148fde

View file

@ -369,6 +369,9 @@ func (c *Client) Send(options TransferOptions) (err error) {
} }
log.Debugf("could not establish '%s'", address) log.Debugf("could not establish '%s'", address)
} }
if conn == nil && err == nil {
err = fmt.Errorf("could not connect")
}
if err != nil { if err != nil {
err = fmt.Errorf("could not connect to %s: %w", c.Options.RelayAddress, err) err = fmt.Errorf("could not connect to %s: %w", c.Options.RelayAddress, err)
log.Debug(err) log.Debug(err)