Commit 03174277 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #10806 from izeye:handle-null-early

* pr/10806:
  Handle null early in Sanitizer.sanitize()
parents 43586382 c7188803
...@@ -79,9 +79,12 @@ class Sanitizer { ...@@ -79,9 +79,12 @@ class Sanitizer {
* @return the potentially sanitized value * @return the potentially sanitized value
*/ */
public Object sanitize(String key, Object value) { public Object sanitize(String key, Object value) {
if (value == null) {
return null;
}
for (Pattern pattern : this.keysToSanitize) { for (Pattern pattern : this.keysToSanitize) {
if (pattern.matcher(key).matches()) { if (pattern.matcher(key).matches()) {
return (value == null ? null : "******"); return "******";
} }
} }
return value; return value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment