summaryrefslogtreecommitdiffstats
path: root/modules/webhook/matrix.go
diff options
context:
space:
mode:
authorCornel <github@codejuggle.dj>2020-06-25 06:39:43 +0300
committerGitHub <noreply@github.com>2020-06-24 23:39:43 -0400
commitebc35f2b2e700b30d288b622cd9409a0f741e928 (patch)
treea332c8ec927a1e05f9b87b2056acbe47085c092a /modules/webhook/matrix.go
parent9ef2f62a799f02ac7960eb3039af9229ec682c55 (diff)
downloadgitea-ebc35f2b2e700b30d288b622cd9409a0f741e928.tar.gz
gitea-ebc35f2b2e700b30d288b622cd9409a0f741e928.zip
Fix comments webhook panic (#12046)
* Fix webhook comment handling type cast panic * Handle HookIssueReviewed action in webhook Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/webhook/matrix.go')
-rw-r--r--modules/webhook/matrix.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/webhook/matrix.go b/modules/webhook/matrix.go
index bf72e6e340..68c65623f7 100644
--- a/modules/webhook/matrix.go
+++ b/modules/webhook/matrix.go
@@ -230,7 +230,11 @@ func GetMatrixPayload(p api.Payloader, event models.HookEventType, meta string)
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getMatrixIssuesPayload(p.(*api.IssuePayload), matrix)
case models.HookEventIssueComment, models.HookEventPullRequestComment:
- return getMatrixIssueCommentPayload(p.(*api.IssueCommentPayload), matrix)
+ pl, ok := p.(*api.IssueCommentPayload)
+ if ok {
+ return getMatrixIssueCommentPayload(pl, matrix)
+ }
+ return getMatrixPullRequestPayload(p.(*api.PullRequestPayload), matrix)
case models.HookEventPush:
return getMatrixPushPayload(p.(*api.PushPayload), matrix)
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,