Browse Source

Validate issue index before querying DB (#16406) (#16410)

tags/v1.14.5
Norwin 4 years ago committed by GitHub
parent
commit
58615be523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      models/issue.go

3
models/issue.go

@ -1034,6 +1034,9 @@ func newIssueAttempt(repo *Repository, issue *Issue, labelIDs []int64, uuids []s
// GetIssueByIndex returns raw issue without loading attributes by index in a repository.
func GetIssueByIndex(repoID, index int64) (*Issue, error) {
if index < 1 {
return nil, ErrIssueNotExist{}
}
issue := &Issue{
RepoID: repoID,
Index: index,

Loading…
Cancel
Save