From 971149d2b298b3408af7218c868ed0b3edd83c2e Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Sat, 4 Jun 2016 10:52:25 -0400 Subject: Don't allow users to be added to a channel they are not in the team of (#3246) --- api/post.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 831591784..cf83c4d0d 100644 --- a/api/post.go +++ b/api/post.go @@ -603,7 +603,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * mentionedUsersList := make([]string, 0, len(mentionedUserIds)) - senderName := profileMap[post.UserId].Username + senderName := "" + if profile, ok := profileMap[post.UserId]; ok { + senderName = profile.Username + } for id := range mentionedUserIds { mentionedUsersList = append(mentionedUsersList, id) -- cgit v1.2.3-1-g7c22