diff options
author | Giteabot <teabot@gitea.io> | 2024-12-19 17:14:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-19 10:14:04 +0100 |
commit | a4291fd55378ee73dbda70a19b93764e8c547377 (patch) | |
tree | 76b7ba2e806c939a96d8a4d371ac502375c368ee /services/webhook | |
parent | fa5a0645597e8f27d613170796e8b7b54fe6f683 (diff) | |
download | gitea-a4291fd55378ee73dbda70a19b93764e8c547377.tar.gz gitea-a4291fd55378ee73dbda70a19b93764e8c547377.zip |
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>
Diffstat (limited to 'services/webhook')
-rw-r--r-- | services/webhook/notifier.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/webhook/notifier.go b/services/webhook/notifier.go index cc263947e9..a3d5cb34b1 100644 --- a/services/webhook/notifier.go +++ b/services/webhook/notifier.go @@ -410,6 +410,10 @@ func (m *webhookNotifier) CreateIssueComment(ctx context.Context, doer *user_mod var pullRequest *api.PullRequest if issue.IsPull { eventType = webhook_module.HookEventPullRequestComment + if err := issue.LoadPullRequest(ctx); err != nil { + log.Error("LoadPullRequest: %v", err) + return + } pullRequest = convert.ToAPIPullRequest(ctx, issue.PullRequest, doer) } else { eventType = webhook_module.HookEventIssueComment |