mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-23 17:59:03 +00:00
Merge pull request #10806 from izeye:handle-null-early
* pr/10806: Handle null early in Sanitizer.sanitize()
This commit is contained in:
+4
-1
@@ -79,9 +79,12 @@ class Sanitizer {
|
||||
* @return the potentially sanitized value
|
||||
*/
|
||||
public Object sanitize(String key, Object value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (Pattern pattern : this.keysToSanitize) {
|
||||
if (pattern.matcher(key).matches()) {
|
||||
return (value == null ? null : "******");
|
||||
return "******";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user