From 63ac506ece96cd0b7f68fd926df69a58056fa63f Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Fri, 29 Jul 2022 19:11:00 +0200 Subject: [PATCH] Fixed offset by one in AspNetRequestDurationLayoutRenderer --- .../LayoutRenderers/AspNetRequestDurationLayoutRenderer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]); }