Added null check to GeolocationCache

- Checks against null country name

Affects issues:
- Close #1101
This commit is contained in:
Rsl1122 2019-07-19 10:56:05 +03:00
parent 8cfbe0aa8c
commit dfff43f917

View File

@ -162,8 +162,9 @@ public class GeolocationCache implements SubSystem {
CountryResponse response = reader.country(inetAddress);
Country country = response.getCountry();
String countryName = country.getName();
return country.getName();
return countryName != null ? countryName : "Not Known";
}
} catch (IOException | GeoIp2Exception e) {