diff options
author | Unknwon <u@gogs.io> | 2016-02-25 14:17:55 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-25 14:17:55 -0500 |
commit | 129638117f1eed78475a041bd65097e56939caca (patch) | |
tree | 23d9c8b6827e986be30511f1cc7d222edf38ab73 /models/issue.go | |
parent | 4438b7793b143c71675b0ae954036830b7afd2b7 (diff) | |
download | gitea-129638117f1eed78475a041bd65097e56939caca.tar.gz gitea-129638117f1eed78475a041bd65097e56939caca.zip |
#2697 fix panic when close issue via commit message
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/issue.go b/models/issue.go index 7d7fb49a61..62db35d48a 100644 --- a/models/issue.go +++ b/models/issue.go @@ -218,7 +218,7 @@ func (i *Issue) ReadBy(uid int64) error { return UpdateIssueUserByRead(uid, i.ID) } -func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) { +func (i *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository, isClosed bool) (err error) { if i.IsClosed == isClosed { return nil } @@ -251,7 +251,7 @@ func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err er } // New action comment. - if _, err = createStatusComment(e, doer, i.Repo, i); err != nil { + if _, err = createStatusComment(e, doer, repo, i); err != nil { return err } @@ -259,14 +259,14 @@ func (i *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err er } // ChangeStatus changes issue status to open/closed. -func (i *Issue) ChangeStatus(doer *User, isClosed bool) (err error) { +func (i *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (err error) { sess := x.NewSession() defer sessionRelease(sess) if err = sess.Begin(); err != nil { return err } - if err = i.changeStatus(sess, doer, isClosed); err != nil { + if err = i.changeStatus(sess, doer, repo, isClosed); err != nil { return err } |