diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-19 15:36:24 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-19 15:36:24 +0800 |
commit | cb66c0137b291984dfbbac480c66db8f30b97964 (patch) | |
tree | a7f61b8978f155f7485933367f8795e34db89ad1 /http_handle_repo_contrib_one.go | |
parent | hooks: Add TODOs on where to create MRs and MR history points (diff) | |
download | forge-cb66c0137b291984dfbbac480c66db8f30b97964.tar.gz forge-cb66c0137b291984dfbbac480c66db8f30b97964.tar.zst forge-cb66c0137b291984dfbbac480c66db8f30b97964.zip |
repo/contrib/one: Add missing error check
Diffstat (limited to 'http_handle_repo_contrib_one.go')
-rw-r--r-- | http_handle_repo_contrib_one.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/http_handle_repo_contrib_one.go b/http_handle_repo_contrib_one.go index 42edd8c..6841f2b 100644 --- a/http_handle_repo_contrib_one.go +++ b/http_handle_repo_contrib_one.go @@ -50,6 +50,10 @@ func handle_repo_contrib_one(w http.ResponseWriter, r *http.Request, params map[ params["destination_commit"] = destination_commit patch, err := destination_commit.Patch(source_commit) + if err != nil { + http.Error(w, "Error getting patch: "+err.Error(), http.StatusInternalServerError) + return + } params["file_patches"] = make_usable_file_patches(patch) render_template(w, "repo_contrib_one", params) |