mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 08:34:26 +00:00
Add more load functions to make sure the reference object loaded (#32901)
Fix #32897
This commit is contained in:
parent
5ec8df02f6
commit
dc8f59baa5
@ -31,6 +31,11 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
|
|||||||
err error
|
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 {
|
if err = pr.Issue.LoadRepo(ctx); err != nil {
|
||||||
log.Error("pr.Issue.LoadRepo[%d]: %v", pr.ID, err)
|
log.Error("pr.Issue.LoadRepo[%d]: %v", pr.ID, err)
|
||||||
return nil
|
return nil
|
||||||
|
@ -410,6 +410,10 @@ func (m *webhookNotifier) CreateIssueComment(ctx context.Context, doer *user_mod
|
|||||||
var pullRequest *api.PullRequest
|
var pullRequest *api.PullRequest
|
||||||
if issue.IsPull {
|
if issue.IsPull {
|
||||||
eventType = webhook_module.HookEventPullRequestComment
|
eventType = webhook_module.HookEventPullRequestComment
|
||||||
|
if err := issue.LoadPullRequest(ctx); err != nil {
|
||||||
|
log.Error("LoadPullRequest: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
pullRequest = convert.ToAPIPullRequest(ctx, issue.PullRequest, doer)
|
pullRequest = convert.ToAPIPullRequest(ctx, issue.PullRequest, doer)
|
||||||
} else {
|
} else {
|
||||||
eventType = webhook_module.HookEventIssueComment
|
eventType = webhook_module.HookEventIssueComment
|
||||||
|
Loading…
Reference in New Issue
Block a user