Skip to content

Commit 10c214d

Browse files
committed
add null check
1 parent 27588c9 commit 10c214d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static async Task SerializedPayloadChunksAsync(
3333

3434
JsonWriter writer = ClientTelemetryPayloadWriter.GetWriterWithSectionStartTag(stringBuilder, properties, "operationInfo");
3535

36-
if (operationInfoSnapshot.Any())
36+
if (operationInfoSnapshot?.Any() == true)
3737
{
3838
foreach (KeyValuePair<OperationInfo, (LongConcurrentHistogram latency, LongConcurrentHistogram requestcharge)> entry in operationInfoSnapshot)
3939
{
@@ -67,7 +67,7 @@ public static async Task SerializedPayloadChunksAsync(
6767
}
6868
writer.WriteEndArray();
6969

70-
if (cacheRefreshInfoSnapshot.Any())
70+
if (cacheRefreshInfoSnapshot?.Any() == true)
7171
{
7272
writer.WritePropertyName("cacheRefreshInfo");
7373
writer.WriteStartArray();
@@ -98,7 +98,7 @@ public static async Task SerializedPayloadChunksAsync(
9898

9999
}
100100

101-
if (requestInfoSnapshot.Any())
101+
if (requestInfoSnapshot?.Any() == true)
102102
{
103103
writer.WritePropertyName("requestInfo");
104104
writer.WriteStartArray();

0 commit comments

Comments
 (0)