From fc47558cc3f9641ff6da41f022e88ad4d4bae5f6 Mon Sep 17 00:00:00 2001 From: Matthew Hensley Date: Tue, 19 Sep 2023 15:02:06 -0400 Subject: [PATCH] null handling --- .../Implementation/HttpWebRequestActivitySource.netfx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs index fad1057f4f8..7ce9f4bac97 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs @@ -162,7 +162,7 @@ private static void AddRequestTagsAndInstrumentRequest(HttpWebRequest request, A [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void AddResponseTags(HttpWebResponse response, Activity activity) { - if (activity.IsAllDataRequested) + if (activity != null && activity.IsAllDataRequested) { if (emitOldAttributes) {