Add more load functions to make sure the reference object loaded (#32901) (#32912)

Backport #32901 by @lunny

Fix #32897

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
GiteabotandLunny Xiao authored and GitHub committed 2024-12-19 10:14:04 +01:00
1 parent fa5a064559
commit a4291fd553
2 files changed
+9

No files matched your search

+5
View File
@@ -31,6 +31,11 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
err error
)
if err = pr.LoadIssue(ctx); err != nil {
log.Error("pr.LoadIssue[%d]: %v", pr.ID, err)
return nil
}
if err = pr.Issue.LoadRepo(ctx); err != nil {
log.Error("pr.Issue.LoadRepo[%d]: %v", pr.ID, err)
return nil