summaryrefslogtreecommitdiff
path: root/doPatch.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-25 01:18:30 -0500
committerJeff Carr <[email protected]>2025-10-25 01:18:30 -0500
commit8f42cdc094968b125f685d4647217cc330b932b9 (patch)
tree286f14251bc3505afcc2db1e470dc10de09566e1 /doPatch.go
parent7b4f0639d861d104c67817e1f47816fa5e80b07d (diff)
catch some nil panics
Diffstat (limited to 'doPatch.go')
-rw-r--r--doPatch.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/doPatch.go b/doPatch.go
index 3a3a688..c7aeca9 100644
--- a/doPatch.go
+++ b/doPatch.go
@@ -66,7 +66,13 @@ func doPatch() (string, error) {
}
psets := forgepb.NewSets()
- newpb, _, _ := psets.HttpPostVerbose(myServer(), "get")
+ newpb, _, err := psets.HttpPostVerbose(myServer(), "get")
+ if err != nil {
+ return "http post failed", err
+ }
+ if newpb == nil {
+ return "psets.HttpPost returned nil", err
+ }
footer, err := doPatchGet(newpb)
if footer == "" {
log.Info(footer)
@@ -323,6 +329,9 @@ func applyPatch(repo *gitpb.Repo, p *forgepb.Patch) (string, error) {
func doPatchGet(newpb *forgepb.Sets) (string, error) {
newpatches := forgepb.NewPatches()
+ if newpb == nil {
+ return "doPatchGet() newpb == nil", errors.New("doPatchGet() newpb == nil")
+ }
for pset := range newpb.IterAll() {
if pset.Patches.Len() == 0 {
log.Info("pset is empty", pset.Name)