diff --git a/src/Shared/LayoutRenderers/AspNetRequestDurationLayoutRenderer.cs b/src/Shared/LayoutRenderers/AspNetRequestDurationLayoutRenderer.cs index 4ad2c50c..774ed525 100644 --- a/src/Shared/LayoutRenderers/AspNetRequestDurationLayoutRenderer.cs +++ b/src/Shared/LayoutRenderers/AspNetRequestDurationLayoutRenderer.cs @@ -97,7 +97,7 @@ private void RenderDurationMs(StringBuilder builder, double durationMs) if (ReferenceEquals(Culture, CultureInfo.InvariantCulture)) { var truncateMs = (long)durationMs; - if (DurationMsFormat != null && truncateMs >= 0 && truncateMs <= DurationMsFormat.Length) + if (DurationMsFormat != null && truncateMs >= 0 && truncateMs < DurationMsFormat.Length) { builder.Append(DurationMsFormat[truncateMs]); } @@ -114,7 +114,7 @@ private void RenderDurationMs(StringBuilder builder, double durationMs) if (preciseMs < 10) builder.Append('0'); - if (DurationMsFormat != null && preciseMs <= DurationMsFormat.Length) + if (DurationMsFormat != null && preciseMs < DurationMsFormat.Length) { builder.Append(DurationMsFormat[preciseMs]); }