From 5f176e497406c1084cae3469edc4003e3bf9f513 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 21 Jun 2016 23:05:54 -0400 Subject: Make sure profile is not nil when assigning in sendNotifications (#3395) --- api/post.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'api/post.go') 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 -- cgit v1.2.3-1-g7c22