mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-22 02:32:02 -08:00
Fix panic when the webhook fails (xmpp) (#1401)
This commit is contained in:
parent
858cdc86f5
commit
ce5140febd
@ -158,10 +158,15 @@ func (b *Bxmpp) postSlackCompatibleWebhook(msg config.Message) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(b.GetString("WebhookURL")+"/"+msg.Channel, "application/json", bytes.NewReader(webhookBody))
|
resp, err := http.Post(b.GetString("WebhookURL")+"/"+msg.Channel, "application/json", bytes.NewReader(webhookBody))
|
||||||
resp.Body.Close()
|
if err != nil {
|
||||||
|
b.Log.Errorf("Failed to POST webhook: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resp.Body.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Bxmpp) createXMPP() error {
|
func (b *Bxmpp) createXMPP() error {
|
||||||
if !strings.Contains(b.GetString("Jid"), "@") {
|
if !strings.Contains(b.GetString("Jid"), "@") {
|
||||||
return fmt.Errorf("the Jid %s doesn't contain an @", b.GetString("Jid"))
|
return fmt.Errorf("the Jid %s doesn't contain an @", b.GetString("Jid"))
|
||||||
|
Loading…
Reference in New Issue
Block a user