aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/issue.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 331ea01fdc..f115d76217 100644
--- a/models/issue.go
+++ b/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,