mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-09 09:05:26 +00:00
Fix panic if forge is unreachable (#3944)
This commit is contained in:
parent
7ab9aafc7f
commit
814fc92bb5
1 changed files with 5 additions and 1 deletions
|
@ -64,7 +64,11 @@ func CreatePipeline(c *gin.Context) {
|
|||
|
||||
user := session.User(c)
|
||||
|
||||
lastCommit, _ := _forge.BranchHead(c, user, repo, opts.Branch)
|
||||
lastCommit, err := _forge.BranchHead(c, user, repo, opts.Branch)
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("could not fetch branch head: %w", err))
|
||||
return
|
||||
}
|
||||
|
||||
tmpPipeline := createTmpPipeline(model.EventManual, lastCommit, user, &opts)
|
||||
|
||||
|
|
Loading…
Reference in a new issue