From e1a5f5bca5150f83a28778701942bc620f883914 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 3 Feb 2017 16:43:21 +0100 Subject: Add more error checking --- matterclient/matterclient.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 93fb7cad..21943566 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -470,11 +470,16 @@ func (m *MMClient) SendDirectMessage(toUserId string, msg string) { _, err := m.Client.CreateDirectChannel(toUserId) if err != nil { m.log.Debugf("SendDirectMessage to %#v failed: %s", toUserId, err) + return } channelName := model.GetDMNameFromIds(toUserId, m.User.Id) // update our channels - mmchannels, _ := m.Client.GetChannels("") + mmchannels, err := m.Client.GetChannels("") + if err != nil { + m.log.Debug("SendDirectMessage: Couldn't update channels") + return + } m.Lock() m.Team.Channels = mmchannels.Data.(*model.ChannelList) m.Unlock() -- cgit v1.2.3