diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 01:28:54 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 01:28:54 -0500 |
| commit | 3f15c10c0cbc2831e10d7ce923f3b1a5c0605e24 (patch) | |
| tree | 20d06ec125422835a5bde9810b2caf2063100091 | |
| parent | 579745b6634c4195c3bc071941c0870dd1bfa129 (diff) | |
found a nil panic. yay! knew about this one in advance
no idea how it is happening. facinating.
| -rw-r--r-- | generateGui.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/generateGui.go b/generateGui.go index 88ea3f3..044c3f5 100644 --- a/generateGui.go +++ b/generateGui.go @@ -246,6 +246,16 @@ func guiStringFuncs(w io.Writer, ZOOPB string, FRUITS string, FRUIT string) { fmt.Fprintln(w, "") fmt.Fprintln(w, " for m := range mt.x.IterAll() {") + fmt.Fprintln(w, " if m == nil {") + fmt.Fprintln(w, " stringValue := wrapperspb.String(string(\"nil in pb.gui\"))") + fmt.Fprintln(w, " anyProto, err := anypb.New(stringValue)") + fmt.Fprintln(w, " if err != nil {") + fmt.Fprintln(w, " // panic shouldn't happen. left here for debugging. can remove this") + fmt.Fprintln(w, " // panic(\"gui.pb.go doFuncNew() autogenpb fixme: need to handle nil here\")") + fmt.Fprintln(w, " }") + fmt.Fprintln(w, " r.Vals = append(r.Vals, anyProto)") + fmt.Fprintln(w, " continue") + fmt.Fprintln(w, " }") fmt.Fprintln(w, " t := sf.f(m)") fmt.Fprintln(w, " switch r.Attr.Type {") fmt.Fprintln(w, " case guipb.ColAttr_STRING:") |
