Skip to content

Commit

Permalink
[docs] Avoid duplicate ToString calls in redaction log processor (ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Jan 24, 2024
1 parent eab0a7c commit 0a77cc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/logs/redaction/MyRedactionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public KeyValuePair<string, object> this[int index]
get
{
var item = this.state[index];
var entryVal = item.Value;
if (entryVal != null && entryVal.ToString() != null && entryVal.ToString().Contains("<secret>"))
var entryVal = item.Value?.ToString();
if (entryVal != null && entryVal.Contains("<secret>"))
{
return new KeyValuePair<string, object>(item.Key, "newRedactedValueHere");
}
Expand Down

0 comments on commit 0a77cc3

Please sign in to comment.