Closed th3ragex closed 2 months ago
1.28.5
While debugging NullReferenceExceptions were observed in PayloadSenderV2. The APM was disabled via: "ELASTIC_APM_ENABLED": "false",
PayloadSenderV2
"ELASTIC_APM_ENABLED": "false",
https://github.com/elastic/apm-agent-dotnet/blob/9a99a2e75d2bf875730d3b0d4ffeccf5e8ae26ce/src/Elastic.Apm/Report/PayloadSenderV2.cs#L184-L185
_logger was null, NRE was raised within Debug method.
_logger
1) Call of extension methods on null object 2) Execution of internal logic even though the object was not fully initialized https://github.com/elastic/apm-agent-dotnet/blob/9a99a2e75d2bf875730d3b0d4ffeccf5e8ae26ce/src/Elastic.Apm/Report/PayloadSenderV2.cs#L75-L77
1) Do not call Extension methods on null 2) Do not call EnqueueEventInternal if APM is disabled
Thanks for reporting this rather nasty bug @th3ragex 🙏 , we will be pushing a new release with a fix shortly.
@Mpdreamz Thank you for your fast and continuous support on this library! 🙏
APM Agent version
1.28.5
Describe the bug
While debugging NullReferenceExceptions were observed in
PayloadSenderV2
. The APM was disabled via:"ELASTIC_APM_ENABLED": "false",
https://github.com/elastic/apm-agent-dotnet/blob/9a99a2e75d2bf875730d3b0d4ffeccf5e8ae26ce/src/Elastic.Apm/Report/PayloadSenderV2.cs#L184-L185
_logger
was null, NRE was raised within Debug method.Observed root causes:
1) Call of extension methods on null object 2) Execution of internal logic even though the object was not fully initialized https://github.com/elastic/apm-agent-dotnet/blob/9a99a2e75d2bf875730d3b0d4ffeccf5e8ae26ce/src/Elastic.Apm/Report/PayloadSenderV2.cs#L75-L77
Expected behavior
1) Do not call Extension methods on null 2) Do not call EnqueueEventInternal if APM is disabled