Skip to content

Commit

Permalink
Merge pull request #19 from surdaft/bugfix/18
Browse files Browse the repository at this point in the history
#18: Fix nil pointer when trying to store memo from slack
  • Loading branch information
surdaft authored Jul 8, 2023
2 parents 74a3daa + c09e753 commit a3b8313
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func (s *SlackService) handleMessage(msg *slackevents.MessageEvent) error {
return err
}

// message is not for us, but not an error, just bail out
if memo == nil {
return nil
}

tags := []string{
"author:" + usr,
"chan:" + ch,
Expand All @@ -114,6 +119,7 @@ func New(config cfg.Slack, parser parser.Parser, store store.Store) (service.Ser
appToken: config.AppToken,

parser: parser,
store: store,

chanIdToNameCache: make(map[string]string),
userIdToNameCache: make(map[string]string),
Expand Down

0 comments on commit a3b8313

Please sign in to comment.