sentry-go
sentry-go copied to clipboard
fix(hub): Do not call AddBreadcrumb if breadcrumb is nil
This PR will allow the function AddBreadcrumb to work even if you pass nil as the breadcrumb. I know it's never supposed to be nil, however in Go if you want something to never be nil you don't use a pointer for it. I thought of making the parameter not a pointer but that would have some implication for the codebase so I decided against that, and I added only 2 nil checks in the function.
What's oryxBuildBinary?
I'm against this, but just a note that it would be much simpler and more readable if you want to achieve this, add a check at beginning (if breadcrumb == nil {return}) instead of checking twice later and doing the same thing.
What's
oryxBuildBinary?I'm against this, but just a note that it would be much simpler and more readable if you want to achieve this, add a check at beginning (if breadcrumb == nil {return}) instead of checking twice later and doing the same thing.
I don't know, it appeared when I ran go test. Regarding the check at the beginning, I thought it would have prevented the BeforeBreadcrumb callback from being executed so I didn't do it. If we don't want BeforeBreadcrumb to be executed when breadcrumb is nil, then it's ok to put the check at the beginning.
What's
oryxBuildBinary?
Found an answer here: https://github.com/orgs/community/discussions/18856#discussioncomment-3142633
It's a build artifacts that's created when you're using Codespaces.