1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 13:37:20 +00:00

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

Fix #32897
This commit is contained in:
Lunny Xiao
2024-12-18 22:10:08 -08:00
committed by GitHub
parent 5ec8df02f6
commit dc8f59baa5
2 changed files with 9 additions and 0 deletions

View File

@ -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