Fix NPE in IpAddressMatcher

Closes gh-15527

(cherry picked from commit 52de894c3c)
This commit is contained in:
Steve Riesenberg
2024-11-14 16:32:04 -06:00
parent f197f21054
commit 554df6fab6
2 changed files with 19 additions and 1 deletions

View File

@@ -71,6 +71,11 @@ public final class IpAddressMatcher implements RequestMatcher {
}
public boolean matches(String address) {
// Do not match null or blank address
if (!StringUtils.hasText(address)) {
return false;
}
assertNotHostName(address);
InetAddress remoteAddress = parseAddress(address);
if (!this.requiredAddress.getClass().equals(remoteAddress.getClass())) {