Skip to content

Commit

Permalink
Fix potential panic due to nil dereference (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Apr 21, 2022
1 parent b5c2d10 commit 60db357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions loadtest/store/memstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,8 @@ func (s *MemStore) MarkAllThreadsInTeamAsRead(teamId string) error {
}
now := model.GetMillis()
for _, thread := range threads {
ch, err := s.Channel(thread.Post.ChannelId)
if err != nil || ch.TeamId != teamId {
ch, _ := s.Channel(thread.Post.ChannelId)
if ch == nil || ch.TeamId != teamId {
// We do our best to keep the local store threads in sync
// If we don't have data in local store, we skip it
// instead of making API calls or failing the whole
Expand Down

0 comments on commit 60db357

Please sign in to comment.