Commit 274f6895 authored by Matija Obreza's avatar Matija Obreza

Fix: Country#code2 may be null

parent a31f8302
......@@ -23,6 +23,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.genesys2.server.model.impl.Country;
import org.genesys2.server.model.impl.GeoRegion;
import org.genesys2.server.service.GeoService;
......@@ -126,7 +127,7 @@ public class GeoRegionDataCLDR {
List<Country> countries = new ArrayList<>();
for (String isoCode : entry.getValue().split(" ")) {
for (Country country : geoService.listAll()) {
if (country.getCode2().equals(isoCode)) {
if (StringUtils.equals(country.getCode2(), isoCode)) {
countries.add(country);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment