mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 18:12:00 -08:00
Returned client will be nil if parameter are incorrect
This commit is contained in:
parent
b8fdc510a6
commit
d45dd6a44a
@ -86,14 +86,14 @@ func NewClient(config Config) (c *Client, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c = new(Client)
|
|
||||||
c.config = config
|
|
||||||
|
|
||||||
// Parse JID
|
// Parse JID
|
||||||
if c.config.parsedJid, err = NewJid(c.config.Jid); err != nil {
|
if config.parsedJid, err = NewJid(c.config.Jid); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c = new(Client)
|
||||||
|
c.config = config
|
||||||
|
|
||||||
if c.config.ConnectTimeout == 0 {
|
if c.config.ConnectTimeout == 0 {
|
||||||
c.config.ConnectTimeout = 15 // 15 second as default
|
c.config.ConnectTimeout = 15 // 15 second as default
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user