summaryrefslogtreecommitdiffstats
path: root/bridge/matrix
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-01-09 23:25:58 +0100
committerWim <wim@42.be>2018-01-09 23:25:58 +0100
commit8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff (patch)
treef7d88a6b4d404d56004d3441b54d249cb6d74b0d /bridge/matrix
parentee87626a9347bd633eec076013e99e28b77f96b4 (diff)
downloadmatterbridge-msglm-8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff.tar.gz
matterbridge-msglm-8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff.tar.bz2
matterbridge-msglm-8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff.zip
Fix possible panics (matrix). Closes #333
Diffstat (limited to 'bridge/matrix')
-rw-r--r--bridge/matrix/matrix.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
index c00883db..4cc524ea 100644
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -91,6 +91,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
if msg.Event == config.EVENT_USER_ACTION {
resp, err := b.mc.SendMessageEvent(channel, "m.room.message",
matrix.TextMessage{"m.emote", msg.Username + msg.Text})
+ if err != nil {
+ return "", err
+ }
return resp.EventID, err
}
@@ -132,6 +135,9 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
}
resp, err := b.mc.SendText(channel, msg.Username+msg.Text)
+ if err != nil {
+ return "", err
+ }
return resp.EventID, err
}