From 8830a5a1dfb2390632e1d82d0d1d5e802fe7dbff Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 9 Jan 2018 23:25:58 +0100 Subject: Fix possible panics (matrix). Closes #333 --- bridge/matrix/matrix.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 } -- cgit v1.2.3