aboutsummaryrefslogtreecommitdiff
path: root/models/comment.go
diff options
context:
space:
mode:
authorAndy Hochhaus <hochhaus@users.noreply.github.com>2017-06-27 16:59:41 -0700
committer无闻 <u@gogs.io>2017-06-27 19:59:41 -0400
commit261237745f3786dc1ca0aea85dde101bd2870be3 (patch)
tree7537076c6a397983af77e9a592fe9118648f965d /models/comment.go
parentc9d76a381be9c10ff0c7a62b048cf20c618c185c (diff)
api: fix ListIssueComments API (#4587)
Diffstat (limited to 'models/comment.go')
-rw-r--r--models/comment.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/comment.go b/models/comment.go
index 0f5b635a..b841c17d 100644
--- a/models/comment.go
+++ b/models/comment.go
@@ -110,6 +110,12 @@ func (c *Comment) loadAttributes(e Engine) (err error) {
if err != nil {
return fmt.Errorf("getIssueByID [%d]: %v", c.IssueID, err)
}
+ if c.Issue.Repo == nil {
+ c.Issue.Repo, err = getRepositoryByID(e, c.Issue.RepoID)
+ if err != nil {
+ return fmt.Errorf("getRepositoryByID [%d]: %v", c.Issue.RepoID, err)
+ }
+ }
}
if c.Attachments == nil {