Skip to content

Commit

Permalink
Fix panic if forge is unreachable (woodpecker-ci#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 authored and 6543 committed Sep 5, 2024
1 parent c3357c5 commit 83dc513
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/api/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 83dc513

Please sign in to comment.