Skip to content

Commit 9498940

Browse files
another null check
1 parent b5116dd commit 9498940

File tree

1 file changed

+5
-2
lines changed
  • tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/Lambda

1 file changed

+5
-2
lines changed

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/Lambda/LambdaCommon.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,12 @@ private static void WriteRequestPayload(WebRequest request, string data)
128128

129129
private static void WriteRequestHeaders(WebRequest request, IDictionary<string, string> context)
130130
{
131-
foreach (var kv in context)
131+
if (context != null)
132132
{
133-
request.Headers.Add(kv.Key, kv.Value);
133+
foreach (var kv in context)
134+
{
135+
request.Headers.Add(kv.Key, kv.Value);
136+
}
134137
}
135138
}
136139

0 commit comments

Comments
 (0)