fix GET /{username}/{reponame}/{type:issues|pulls}/{index}/content-history/detail

(cherry picked from commit 0853dec293dd632a03948f66af69e75dd582a92d)
This commit is contained in:
Loïc Dachary 2023-11-12 18:45:40 +01:00
parent bebc244156
commit dd5bf75a5c
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2

View file

@ -129,6 +129,10 @@ func GetContentHistoryDetail(ctx *context.Context) {
})
return
}
if history.IssueID != issue.ID {
ctx.NotFound("CompareRepoID", issues_model.ErrCommentNotExist{})
return
}
// get the related comment if this history revision is for a comment, otherwise the history revision is for an issue.
var comment *issues_model.Comment