Skip to content

Commit

Permalink
Fix panic when adding long comment (#12892)
Browse files Browse the repository at this point in the history
Previous PR #12881 causes out of bounds panic by working on wrong string.
  • Loading branch information
mrsdizzie authored Sep 18, 2020
1 parent 54ae448 commit 25ddf77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/notification/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 25ddf77

Please sign in to comment.