From fe803f80646bfc75e531ec486725e3cd5b5dee5a Mon Sep 17 00:00:00 2001 From: dave vader <48764154+plyr4@users.noreply.github.com> Date: Fri, 12 Apr 2024 12:20:36 -0500 Subject: [PATCH] fix: nil panic after CompileAndPublish (#1105) --- api/build/compile_publish.go | 2 ++ api/webhook/post.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/api/build/compile_publish.go b/api/build/compile_publish.go index 69d6098e0..a9d52645f 100644 --- a/api/build/compile_publish.go +++ b/api/build/compile_publish.go @@ -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 } diff --git a/api/webhook/post.go b/api/webhook/post.go index 82db4a899..f964398d7 100644 --- a/api/webhook/post.go +++ b/api/webhook/post.go @@ -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