mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 11:15:19 +01:00
Ignore country check for localhost.
- don't log exception to console
This commit is contained in:
parent
64688c7ae6
commit
fbdd56d9de
@ -89,11 +89,11 @@ public class GeoLiteAPI {
|
||||
* @return String
|
||||
*/
|
||||
public static String getCountryCode(String ip) {
|
||||
if (isDataAvailable()) {
|
||||
if (!"127.0.0.1".equals(ip) && isDataAvailable()) {
|
||||
try {
|
||||
return databaseReader.country(InetAddress.getByName(ip)).getCountry().getIsoCode();
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.logException("Error while getting country code", e);
|
||||
ConsoleLogger.writeStackTrace(e);
|
||||
}
|
||||
}
|
||||
return "--";
|
||||
@ -107,11 +107,11 @@ public class GeoLiteAPI {
|
||||
* @return String
|
||||
*/
|
||||
public static String getCountryName(String ip) {
|
||||
if (isDataAvailable()) {
|
||||
if (!"127.0.0.1".equals(ip) && isDataAvailable()) {
|
||||
try {
|
||||
return databaseReader.country(InetAddress.getByName(ip)).getCountry().getName();
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.logException("Error while getting country name", e);
|
||||
ConsoleLogger.writeStackTrace(e);
|
||||
}
|
||||
}
|
||||
return "N/A";
|
||||
|
Loading…
Reference in New Issue
Block a user