summaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAlexander <papatutuwawa@polynom.me>2021-02-15 22:18:30 +0100
committerGitHub <noreply@github.com>2021-02-15 22:18:30 +0100
commitce5140febd21076d4ea362450f719580d47e59ae (patch)
tree00b1e18792bd661cf6d665eba9fa7585a45f55e5 /bridge
parent858cdc86f58a4be0f8aca2ed325ad57398fb8339 (diff)
downloadmatterbridge-msglm-ce5140febd21076d4ea362450f719580d47e59ae.tar.gz
matterbridge-msglm-ce5140febd21076d4ea362450f719580d47e59ae.tar.bz2
matterbridge-msglm-ce5140febd21076d4ea362450f719580d47e59ae.zip
Fix panic when the webhook fails (xmpp) (#1401)
Diffstat (limited to 'bridge')
-rw-r--r--bridge/xmpp/xmpp.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go
index e92c3d69..b471326b 100644
--- a/bridge/xmpp/xmpp.go
+++ b/bridge/xmpp/xmpp.go
@@ -158,8 +158,13 @@ func (b *Bxmpp) postSlackCompatibleWebhook(msg config.Message) error {
}
resp, err := http.Post(b.GetString("WebhookURL")+"/"+msg.Channel, "application/json", bytes.NewReader(webhookBody))
+ if err != nil {
+ b.Log.Errorf("Failed to POST webhook: %s", err)
+ return err
+ }
+
resp.Body.Close()
- return err
+ return nil
}
func (b *Bxmpp) createXMPP() error {