summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/issue.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index b9643ae00e..225dfee20f 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1018,6 +1018,9 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
// 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,