Skip to content

Commit 5f1ba24

Browse files
committed
fallback to git host Id
1 parent 0a13d55 commit 5f1ba24

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/RestHandler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ func (handler RestHandlerImpl) GetAllWebhookEventConfigForHost(w http.ResponseWr
432432
var webhookEventConfigArr []*git.WebhookEventConfig
433433
if request.GitHostName != "" {
434434
webhookEventConfigArr, err = handler.repositoryManager.GetAllWebhookEventConfigForHostName(request.GitHostName)
435+
if webhookEventConfigArr == nil || len(webhookEventConfigArr) == 0 {
436+
//fallback to try with gitHostId
437+
webhookEventConfigArr, err = handler.repositoryManager.GetAllWebhookEventConfigForHost(request.GitHostId)
438+
}
435439
} else {
436440
webhookEventConfigArr, err = handler.repositoryManager.GetAllWebhookEventConfigForHost(request.GitHostId)
437441
}

0 commit comments

Comments
 (0)