diff --git a/src/main/java/net/frozenorb/apiv3/model/User.java b/src/main/java/net/frozenorb/apiv3/model/User.java index b59e876..27db18e 100644 --- a/src/main/java/net/frozenorb/apiv3/model/User.java +++ b/src/main/java/net/frozenorb/apiv3/model/User.java @@ -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; } diff --git a/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdRequiresTotp.java b/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdRequiresTotp.java index 61df223..c4e9c41 100644 --- a/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdRequiresTotp.java +++ b/src/main/java/net/frozenorb/apiv3/route/users/GETUsersIdRequiresTotp.java @@ -25,7 +25,7 @@ public final class GETUsersIdRequiresTotp implements Handler { 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; } diff --git a/src/main/java/net/frozenorb/apiv3/util/TotpUtils.java b/src/main/java/net/frozenorb/apiv3/util/TotpUtils.java index 77e94cb..3e1f7fe 100644 --- a/src/main/java/net/frozenorb/apiv3/util/TotpUtils.java +++ b/src/main/java/net/frozenorb/apiv3/util/TotpUtils.java @@ -26,7 +26,7 @@ public class TotpUtils { } public static void isPreAuthorized(User user, String ip, SingleResultCallback 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 callback) { - if (ip == null || !IpUtils.isValidIp(ip)) { + if (!IpUtils.isValidIp(ip)) { callback.onResult(null, null); return; }