summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-02-03 16:43:21 +0100
committerWim <wim@42.be>2017-02-03 16:43:21 +0100
commite1a5f5bca5150f83a28778701942bc620f883914 (patch)
tree723f09c10cfebd79e930b7b30504505463cd212c
parent6e772ee189647f25ad35b5fd7cd009282a41378b (diff)
downloadmatterbridge-msglm-e1a5f5bca5150f83a28778701942bc620f883914.tar.gz
matterbridge-msglm-e1a5f5bca5150f83a28778701942bc620f883914.tar.bz2
matterbridge-msglm-e1a5f5bca5150f83a28778701942bc620f883914.zip
Add more error checking
-rw-r--r--matterclient/matterclient.go7
1 files changed, 6 insertions, 1 deletions
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()