diff options
| author | Jeff Carr <[email protected]> | 2025-10-25 01:18:30 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-25 01:18:30 -0500 |
| commit | 8f42cdc094968b125f685d4647217cc330b932b9 (patch) | |
| tree | 286f14251bc3505afcc2db1e470dc10de09566e1 /doPatch.go | |
| parent | 7b4f0639d861d104c67817e1f47816fa5e80b07d (diff) | |
catch some nil panics
Diffstat (limited to 'doPatch.go')
| -rw-r--r-- | doPatch.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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) |
