From 0a77cc3cced0be0a24dd54cd4707cf71c2b97314 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Tue, 23 Jan 2024 16:46:24 -0800 Subject: [PATCH] [docs] Avoid duplicate ToString calls in redaction log processor (#5248) --- docs/logs/redaction/MyRedactionProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/logs/redaction/MyRedactionProcessor.cs b/docs/logs/redaction/MyRedactionProcessor.cs index 96b2898524e..7959faf3d60 100644 --- a/docs/logs/redaction/MyRedactionProcessor.cs +++ b/docs/logs/redaction/MyRedactionProcessor.cs @@ -31,8 +31,8 @@ public KeyValuePair this[int index] get { var item = this.state[index]; - var entryVal = item.Value; - if (entryVal != null && entryVal.ToString() != null && entryVal.ToString().Contains("")) + var entryVal = item.Value?.ToString(); + if (entryVal != null && entryVal.Contains("")) { return new KeyValuePair(item.Key, "newRedactedValueHere"); }