This commit is contained in:
@@ -37,7 +37,8 @@ public class GeoCountryService {
|
||||
try {
|
||||
CountryResponse response = extractCountry(input);
|
||||
|
||||
return response.getCountry().getName();
|
||||
return response.getCountry().getName() == null ? "Not defined":
|
||||
response.getCountry().getName();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed for input: {}", input, e);
|
||||
return "UNKNOWN";
|
||||
@@ -83,7 +84,8 @@ public class GeoCountryService {
|
||||
try {
|
||||
CountryResponse response = extractCountry(input);
|
||||
|
||||
return response.getCountry().getIsoCode();
|
||||
return response.getCountry().getIsoCode() == null ? "Not defined":
|
||||
response.getCountry().getIsoCode();
|
||||
} catch (Exception e) {
|
||||
log.error("Failed for input: {}", input, e);
|
||||
return "UNKNOWN";
|
||||
|
||||
Reference in New Issue
Block a user