aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2020-09-18 16:45:00 -0400
committerGitHub <noreply@github.com>2020-09-18 16:45:00 -0400
commit23aae3274a89fbefc8a02761fc5b4544981e6028 (patch)
treed22ddb6d122102f9f1f1fb9451670ee407ba8480
parenta98bf03204a7bbfeea35fbea23efa49f25b6cb24 (diff)
downloadgitea-23aae3274a89fbefc8a02761fc5b4544981e6028.tar.gz
gitea-23aae3274a89fbefc8a02761fc5b4544981e6028.zip
Fix panic when adding long comment (#12892) (#12894)
Previous PR #12881 causes out of bounds panic by working on wrong string.
-rw-r--r--modules/notification/action/action.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go
index a62f1e13ad..5fde862fd1 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
}