Closed wzy9607 closed 7 months ago
sanitizer.Sanitize may cause panic by calling value method using nil pointer.
package main import ( "errors" bugsnago "github.com/bugsnag/bugsnag-go/v2" ) type Name struct { name string } func (n Name) String() string { return n.name } type data struct { Name *Name } func main() { err := errors.New("error") meta := bugsnago.MetaData{} meta.AddStruct("data", map[string]any{ "data": data{Name: nil}, }) _ = bugsnago.Notify(err, meta) }
I see there is already a pr #221 fixing this, so I'll close this issue.
@wzy9607 Hey, the fix is merged and released in v2.3.1.
Describe the bug
sanitizer.Sanitize may cause panic by calling value method using nil pointer.
Steps to reproduce
Environment
Example code snippet
Error messages:
``` panic: value method main.Name.String called using nil *Name pointer goroutine 1 [running]: main.(*Name).String(0xc00006c0e0?)