Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent NullReferenceException in SentryTraceHeader Parsing #3757

Open
wants to merge 7 commits into
base: version-5.0.0
Choose a base branch
from

Conversation

Victorvhn
Copy link

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 Parse method in SentryTraceHeader.cs. The method was attempting to call .Split() on this null value, leading to an NullReferenceException.

To address this, I added a null check in the Parse method 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

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (version-5.0.0@0e610de). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             version-5.0.0    #3757   +/-   ##
================================================
  Coverage                 ?   76.53%           
================================================
  Files                    ?      381           
  Lines                    ?    13997           
  Branches                 ?     2818           
================================================
  Hits                     ?    10713           
  Misses                   ?     2596           
  Partials                 ?      688           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants