summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-08-14 23:04:28 +0200
committerWim <wim@42.be>2016-08-14 23:04:28 +0200
commita1a11a88b334a4deb78915336def0113eec9738b (patch)
treebc2a04978537c4a35258fae63fe3993159644ac9
parenta997ae29ad5297a85ef1e303ec36aaab9e163408 (diff)
downloadmatterbridge-msglm-a1a11a88b334a4deb78915336def0113eec9738b.tar.gz
matterbridge-msglm-a1a11a88b334a4deb78915336def0113eec9738b.tar.bz2
matterbridge-msglm-a1a11a88b334a4deb78915336def0113eec9738b.zip
Fix nil pointers
-rw-r--r--matterclient/matterclient.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go
index 75e67c5c..aa2baabf 100644
--- a/matterclient/matterclient.go
+++ b/matterclient/matterclient.go
@@ -255,7 +255,10 @@ func (m *MMClient) parseActionPost(rmsg *Message) {
}
func (m *MMClient) UpdateUsers() error {
- mmusers, _ := m.Client.GetProfilesForDirectMessageList(m.Team.Id)
+ mmusers, err := m.Client.GetProfilesForDirectMessageList(m.Team.Id)
+ if err != nil {
+ return errors.New(err.DetailedError)
+ }
m.Lock()
m.Users = mmusers.Data.(map[string]*model.User)
m.Unlock()
@@ -263,8 +266,14 @@ func (m *MMClient) UpdateUsers() error {
}
func (m *MMClient) UpdateChannels() error {
- mmchannels, _ := m.Client.GetChannels("")
- mmchannels2, _ := m.Client.GetMoreChannels("")
+ mmchannels, err := m.Client.GetChannels("")
+ if err != nil {
+ return errors.New(err.DetailedError)
+ }
+ mmchannels2, err := m.Client.GetMoreChannels("")
+ if err != nil {
+ return errors.New(err.DetailedError)
+ }
m.Lock()
m.Team.Channels = mmchannels.Data.(*model.ChannelList)
m.Team.MoreChannels = mmchannels2.Data.(*model.ChannelList)