aboutsummaryrefslogtreecommitdiffstats
path: root/services/convert
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-12-18 22:10:08 -0800
committerGitHub <noreply@github.com>2024-12-19 14:10:08 +0800
commitdc8f59baa54d4f47edab6feb76a6903947584326 (patch)
treec2bb8969e39f51742963292816b3ed70e9186a4f /services/convert
parent5ec8df02f64aac05b99e9133d2a831fbc07b379d (diff)
downloadgitea-dc8f59baa54d4f47edab6feb76a6903947584326.tar.gz
gitea-dc8f59baa54d4f47edab6feb76a6903947584326.zip
Add more load functions to make sure the reference object loaded (#32901)
Fix #32897
Diffstat (limited to 'services/convert')
-rw-r--r--services/convert/pull.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/convert/pull.go b/services/convert/pull.go
index ddaaa300a4..a1ab7eeb8e 100644
--- a/services/convert/pull.go
+++ b/services/convert/pull.go
@@ -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