Skip to content

Commit 167f357

Browse files
committed
Some event do not carry timings information but DebugInformation still tries to display timings information (#3783)
(cherry picked from commit 0fca6d0)
1 parent d084a8f commit 167f357

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Elasticsearch.Net/Responses/ResponseStatics.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public static void DebugAuditTrail(List<Audit> auditTrail, StringBuilder sb)
5454
AuditNodeUrl(sb, audit);
5555

5656
if (audit.Exception != null) sb.Append($" Exception: {audit.Exception.GetType().Name}");
57-
sb.AppendLine($" Took: {(audit.Ended - audit.Started).ToString()}");
57+
if (audit.Ended == default)
58+
sb.AppendLine();
59+
else sb.AppendLine($" Took: {(audit.Ended - audit.Started).ToString()}");
5860
}
5961
}
6062

0 commit comments

Comments
 (0)