Skip to content

Commit

Permalink
Validate issue index before querying DB (#16406) (#16410)
Browse files Browse the repository at this point in the history
  • Loading branch information
noerw committed Jul 12, 2021
1 parent 6df82db commit 58615be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 58615be

Please sign in to comment.