Browse Source

Fix panic when adding long comment (#12892)

Previous PR #12881 causes out of bounds panic by working on wrong string.
for-closed-social
mrsdizzie 4 years ago
committed by GitHub
parent
commit
25ddf77b51
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/notification/action/action.go

+ 1
- 1
modules/notification/action/action.go View File

@ -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
}

Loading…
Cancel
Save