summaryrefslogtreecommitdiffstats
path: root/modules/webhook/msteams.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/msteams.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/msteams.go')
-rw-r--r--modules/webhook/msteams.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/webhook/msteams.go b/modules/webhook/msteams.go
index a0925010d6..e7ec396f29 100644
--- a/modules/webhook/msteams.go
+++ b/modules/webhook/msteams.go
@@ -558,7 +558,11 @@ func GetMSTeamsPayload(p api.Payloader, event models.HookEventType, meta string)
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getMSTeamsIssuesPayload(p.(*api.IssuePayload))
case models.HookEventIssueComment, models.HookEventPullRequestComment:
- return getMSTeamsIssueCommentPayload(p.(*api.IssueCommentPayload))
+ pl, ok := p.(*api.IssueCommentPayload)
+ if ok {
+ return getMSTeamsIssueCommentPayload(pl)
+ }
+ return getMSTeamsPullRequestPayload(p.(*api.PullRequestPayload))
case models.HookEventPush:
return getMSTeamsPushPayload(p.(*api.PushPayload))
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,