Explorar o código

skip issue index parsing while using external issue tracker

Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
e5092cbdba
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      models/issue.go

+ 4 - 4
models/issue.go

@@ -813,13 +813,13 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
 // See https://help.github.com/articles/writing-on-github#references for more information on the syntax.
 func GetIssueByRef(ref string) (*Issue, error) {
 	n := strings.IndexByte(ref, byte('#'))
-	if index == 0 {
-		return nil, errors.IssueNotExist{}
+	if n == -1 {
+		return nil, errors.InvalidIssueReference{ref}
 	}
 
 	index := com.StrTo(ref[n+1:]).MustInt64()
-	if err != nil {
-		return nil, err
+	if index == 0 {
+		return nil, errors.IssueNotExist{}
 	}
 
 	repo, err := GetRepositoryByRef(ref[:n])