forked from jshiffer/go-xmpp
Merge pull request #45 from seletskiy/master
do not crash on failed connect
This commit is contained in:
commit
0a3375a6ad
6
xmpp.go
6
xmpp.go
@ -224,7 +224,11 @@ func NewClientNoTLS(host, user, passwd string, debug bool) (*Client, error) {
|
||||
}
|
||||
|
||||
func (c *Client) Close() error {
|
||||
return c.conn.Close()
|
||||
if c.conn != (*tls.Conn)(nil) {
|
||||
return c.conn.Close()
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func saslDigestResponse(username, realm, passwd, nonce, cnonceStr,
|
||||
|
Loading…
Reference in New Issue
Block a user