From 23aae3274a89fbefc8a02761fc5b4544981e6028 Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Fri, 18 Sep 2020 16:45:00 -0400 Subject: [PATCH] Fix panic when adding long comment (#12892) (#12894) Previous PR #12881 causes out of bounds panic by working on wrong string. --- modules/notification/action/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go index a62f1e13a..5fde862fd 100644 --- a/modules/notification/action/action.go +++ b/modules/notification/action/action.go @@ -102,7 +102,7 @@ func (a *actionNotifier) NotifyCreateIssueComment(doer *models.User, repo *model content := "" if len(comment.Content) > 200 { - content = content[:strings.LastIndex(comment.Content[0:200], " ")] + "…" + content = comment.Content[:strings.LastIndex(comment.Content[0:200], " ")] + "…" } else { content = comment.Content }