diff options
author | Alexander <papatutuwawa@polynom.me> | 2021-02-15 22:18:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-15 22:18:30 +0100 |
commit | ce5140febd21076d4ea362450f719580d47e59ae (patch) | |
tree | 00b1e18792bd661cf6d665eba9fa7585a45f55e5 /bridge/xmpp | |
parent | 858cdc86f58a4be0f8aca2ed325ad57398fb8339 (diff) | |
download | matterbridge-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/xmpp')
-rw-r--r-- | bridge/xmpp/xmpp.go | 7 |
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 { |