getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
604 stars 206 forks source link

Fix ArgumentNullException in SentryTraceHeader when parsing null values #3744

Closed Victorvhn closed 2 weeks ago

Victorvhn commented 2 weeks ago

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 ArgumentNullException.

To address this, I added a null check in the Parse method before calling .Split().