Skip to content

Commit 0317427

Browse files
committed
Merge pull request #10806 from izeye:handle-null-early
* pr/10806: Handle null early in Sanitizer.sanitize()
2 parents 4358638 + c718880 commit 0317427

File tree

1 file changed

+4
-1
lines changed
  • spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint

1 file changed

+4
-1
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ private boolean isRegex(String value) {
7979
* @return the potentially sanitized value
8080
*/
8181
public Object sanitize(String key, Object value) {
82+
if (value == null) {
83+
return null;
84+
}
8285
for (Pattern pattern : this.keysToSanitize) {
8386
if (pattern.matcher(key).matches()) {
84-
return (value == null ? null : "******");
87+
return "******";
8588
}
8689
}
8790
return value;

0 commit comments

Comments
 (0)