Skip to content

Commit

Permalink
Fix panic if forge is unreachable (#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 committed Jul 20, 2024
1 parent 54b91db commit 8e2ff33
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 8e2ff33

Please sign in to comment.