|
|
@@ -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])
|