Skip to content

Commit 0a77cc3

Browse files
authored
[docs] Avoid duplicate ToString calls in redaction log processor (#5248)
1 parent eab0a7c commit 0a77cc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/logs/redaction/MyRedactionProcessor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public KeyValuePair<string, object> this[int index]
3131
get
3232
{
3333
var item = this.state[index];
34-
var entryVal = item.Value;
35-
if (entryVal != null && entryVal.ToString() != null && entryVal.ToString().Contains("<secret>"))
34+
var entryVal = item.Value?.ToString();
35+
if (entryVal != null && entryVal.Contains("<secret>"))
3636
{
3737
return new KeyValuePair<string, object>(item.Key, "newRedactedValueHere");
3838
}

0 commit comments

Comments
 (0)