From 7fff703cb8e94255bd285c2ba879f3ae19097238 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Wed, 12 Feb 2025 02:17:38 +0800 Subject: [PATCH] repo_commit: Add missing error check --- handle_repo_commit.go | 4 ++++ diff --git a/handle_repo_commit.go b/handle_repo_commit.go index aeea380317c734f3b17f8d334c15465201141abc..58c399223dec899bf77948b2787f2514c3dcde69 100644 --- a/handle_repo_commit.go +++ b/handle_repo_commit.go @@ -52,6 +52,10 @@ data["commit_object"] = commit_object data["commit_id"] = commit_id_string parent_commit_hash, patch, err := get_patch_from_commit(commit_object) + if err != nil { + _, _ = w.Write([]byte("Error getting patch from commit: " + err.Error())) + return + } data["parent_commit_hash"] = parent_commit_hash.String() data["patch"] = patch -- 2.48.1