From a1a11a88b334a4deb78915336def0113eec9738b Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 14 Aug 2016 23:04:28 +0200 Subject: Fix nil pointers --- matterclient/matterclient.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'matterclient') 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) -- cgit v1.2.3