Skip to content

Commit

Permalink
make sure conn is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Aug 27, 2020
1 parent 50bf003 commit 2345148
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/croc/croc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2345148

Please sign in to comment.