diff --git a/services/issue/comments.go b/services/issue/comments.go index 2b3bc38b65..9c956fcc09 100644 --- a/services/issue/comments.go +++ b/services/issue/comments.go @@ -82,8 +82,10 @@ func CreateIssueComment(ctx context.Context, doer *user_model.User, repo *repo_m } // reload issue to ensure it has the latest data, especially the number of comments - if issue, err = issues_model.GetIssueByID(ctx, issue.ID); err != nil { + if reloadedIssue, err := issues_model.GetIssueByID(ctx, issue.ID); err != nil { log.Error("GetIssueByID: %v", err) + } else { + issue = reloadedIssue } notify_service.CreateIssueComment(ctx, doer, repo, issue, comment, mentions)