Skip to content

Commit

Permalink
fix: nil panic after CompileAndPublish (#1105)
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 authored Apr 12, 2024
1 parent 37bdad3 commit fe803f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/build/compile_publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ func CompileAndPublish(
// error out the build
CleanBuild(c, database, b, nil, nil, retErr)

util.HandleError(c, http.StatusBadRequest, retErr)

return nil, nil, retErr
}

Expand Down
5 changes: 5 additions & 0 deletions api/webhook/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ func PostWebhook(c *gin.Context) {
queue.FromContext(c),
)

// error handling done in CompileAndPublish
if err != nil {
return
}

// capture the build and repo from the items
b, repo = item.Build, item.Repo

Expand Down

0 comments on commit fe803f8

Please sign in to comment.