Remove ip null checks directly before a call to IpUtils#isValidIp, as IpUtils#isValidIp will perform a null check automatically
This commit is contained in:
parent
f04ee19b6c
commit
ea70e1b347
@ -410,7 +410,7 @@ public final class User {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ip == null || !IpUtils.isValidIp(ip)) {
|
||||
if (!IpUtils.isValidIp(ip)) {
|
||||
callback.onResult(RequiresTotpResult.REQUIRED_NO_EXEMPTIONS, null);
|
||||
return;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public final class GETUsersIdRequiresTotp implements Handler<RoutingContext> {
|
||||
|
||||
String userIp = ctx.request().getParam("userIp");
|
||||
|
||||
if (userIp != null && IpUtils.isValidIp(userIp)) {
|
||||
if (IpUtils.isValidIp(userIp)) {
|
||||
ErrorUtils.respondInvalidInput(ctx, "Ip address \"" + userIp + "\" is not valid.");
|
||||
return;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ public class TotpUtils {
|
||||
}
|
||||
|
||||
public static void isPreAuthorized(User user, String ip, SingleResultCallback<Boolean> callback) {
|
||||
if (ip == null || !IpUtils.isValidIp(ip)) {
|
||||
if (!IpUtils.isValidIp(ip)) {
|
||||
callback.onResult(false, null);
|
||||
return;
|
||||
}
|
||||
@ -41,7 +41,7 @@ public class TotpUtils {
|
||||
}
|
||||
|
||||
public static void markPreAuthorized(User user, String ip, long duration, TimeUnit unit, SingleResultCallback<Void> callback) {
|
||||
if (ip == null || !IpUtils.isValidIp(ip)) {
|
||||
if (!IpUtils.isValidIp(ip)) {
|
||||
callback.onResult(null, null);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user