rollbar / Rollbar.NET

Rollbar for .NET
https://docs.rollbar.com/docs/dotnet
MIT License
65 stars 44 forks source link

NullReference exception while initializing RollbarInfrastructure #623

Closed akornich closed 2 years ago

akornich commented 2 years ago

IF YOU ARE TARGETING ANY OF THE SDK-SUPPORTED .NET FRAMEWORK VERSIONS, THIS ISSUE PREVENTS YOU FROM USING THE ROLLBAR INFRASTRUCTURE BUT YOU CAN STILL USE ROLLBAR LOGGERS WITHOUT INITIALIZING THE INFRASTRUCTURE.

CODEBASES TARGETING .NET CORE ARE NOT AFFECTED BY THIS ISSUE.

The issue was reported here: https://gitter.im/rollbar/SDK-dotnet?at=62294020257a3578252097b0

This problem only appears in the SDK Release builds targeting any supported .NET Framework version. No Debug builds present this problem. Any kind of builds targeting .NET Core works just fine.

The exception is actually thrown whole setting _isInitialized flag to true. That is odd since it implies that this is null that that point taking into account that 2 prior lines were good and in the repro case we are running in a single-thread environment.