bug: don't redact text when serialization if not value (#2379)
### Description
The current approach injects the redacted text for all sensitive fields
regardless of if they have a value or not. This updates the code to only
replace the value with the redacted text if the value exists.