summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-06-21 23:05:54 -0400
committerGitHub <noreply@github.com>2016-06-21 23:05:54 -0400
commit5f176e497406c1084cae3469edc4003e3bf9f513 (patch)
tree6c1f58a999b93ae87cb620458c4c70a6b7633303 /api/post.go
parent295d26570985fe6cb7e03395e760bbb93bfb50b2 (diff)
downloadchat-5f176e497406c1084cae3469edc4003e3bf9f513.tar.gz
chat-5f176e497406c1084cae3469edc4003e3bf9f513.tar.bz2
chat-5f176e497406c1084cae3469edc4003e3bf9f513.zip
Make sure profile is not nil when assigning in sendNotifications (#3395)
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go
index 2eef5eabd..5f9c7e584 100644
--- a/api/post.go
+++ b/api/post.go
@@ -493,7 +493,9 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
// Find out who is a member of the channel, only keep those profiles
tempProfileMap := make(map[string]*model.User)
for _, member := range members {
- tempProfileMap[member.UserId] = profileMap[member.UserId]
+ if profile, ok := profileMap[member.UserId]; ok {
+ tempProfileMap[member.UserId] = profile
+ }
}
profileMap = tempProfileMap