Prevent NullReferenceException in SentryTraceHeader Parsing#3757
Prevent NullReferenceException in SentryTraceHeader Parsing#3757jamescrosswell merged 8 commits intogetsentry:version-5.0.0from Victorvhn:fix/prevent-null-reference-sentry-trace-header-parser-on-v5
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## version-5.0.0 #3757 +/- ##
================================================
Coverage ? 76.54%
================================================
Files ? 381
Lines ? 13997
Branches ? 2818
================================================
Hits ? 10714
Misses ? 2595
Partials ? 688 ☔ View full report in Codecov by Sentry. |
bruno-garcia
left a comment
There was a problem hiding this comment.
Any particular reason you picked v5 branch for this fix? Would be great to put this out there for v4 too.
Oh, because it's a breaking change it seems?
Yeah, I guess it’s because I’m changing the signature of a public method. So the team asked me to open it to v5 instead of main. But I think it will be released soon since v5 will add support for .NET 9 |
jamescrosswell
left a comment
There was a problem hiding this comment.
Big thank you for the PR @Victorvhn and for fussing around with the branches. Much appreciated!
Hey y'all,
I recently encountered an issue where nearly every API request threw an exception after integrating Sentry with OpenTelemetry in my APIs. This issue only affected my environment, likely due to having Just My Code disabled in debugging options.
Upon investigation, I discovered that a null value was being passed to the
Parsemethod inSentryTraceHeader.cs. The method was attempting to call.Split()on this null value, leading to anNullReferenceException.To address this, I added a null check in the
Parsemethod before calling.Split().Please review the changes when you have a chance and let me know if there are any additional adjustments or improvements you’d like to see. Thank you!
Moved from PR