Skip to content

Commit 23aae32

Browse files
authored
Fix panic when adding long comment (#12892) (#12894)
Previous PR #12881 causes out of bounds panic by working on wrong string.
1 parent a98bf03 commit 23aae32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/notification/action/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (a *actionNotifier) NotifyCreateIssueComment(doer *models.User, repo *model
102102
content := ""
103103

104104
if len(comment.Content) > 200 {
105-
content = content[:strings.LastIndex(comment.Content[0:200], " ")] + "…"
105+
content = comment.Content[:strings.LastIndex(comment.Content[0:200], " ")] + "…"
106106
} else {
107107
content = comment.Content
108108
}

0 commit comments

Comments
 (0)