diff options
author | Wim <wim@42.be> | 2018-01-09 23:25:58 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-01-09 23:25:58 +0100 |
commit | 8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff (patch) | |
tree | f7d88a6b4d404d56004d3441b54d249cb6d74b0d /bridge/matrix | |
parent | ee87626a9347bd633eec076013e99e28b77f96b4 (diff) | |
download | matterbridge-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.go | 6 |
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 } |