Преглед на файлове

api: fix ListIssueComments API (#4587)

Andy Hochhaus преди 7 години
родител
ревизия
261237745f
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      models/comment.go

+ 6 - 0
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 {