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
1 changed files with 3 additions and 0 deletions

View File

@ -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)