Skip to content

Commit

Permalink
add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Mar 8, 2023
1 parent 6ad1d99 commit b70f540
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal static class ClientTelemetryPayloadWriter

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

if (operationInfoSnapshot.Any())
if (operationInfoSnapshot?.Any() == true)
{
foreach (KeyValuePair<OperationInfo, (LongConcurrentHistogram latency, LongConcurrentHistogram requestcharge)> entry in operationInfoSnapshot)
{
Expand Down Expand Up @@ -67,7 +67,7 @@ internal static class ClientTelemetryPayloadWriter
}
writer.WriteEndArray();

if (cacheRefreshInfoSnapshot.Any())
if (cacheRefreshInfoSnapshot?.Any() == true)
{
writer.WritePropertyName("cacheRefreshInfo");
writer.WriteStartArray();
Expand Down Expand Up @@ -98,7 +98,7 @@ internal static class ClientTelemetryPayloadWriter

}

if (requestInfoSnapshot.Any())
if (requestInfoSnapshot?.Any() == true)
{
writer.WritePropertyName("requestInfo");
writer.WriteStartArray();
Expand Down

0 comments on commit b70f540

Please sign in to comment.