Fix null pointer
This commit is contained in:
parent
4653cf4c50
commit
bbed3776a4
1 changed files with 10 additions and 7 deletions
|
@ -602,7 +602,9 @@ public class IndexAddressCreator extends AbstractIndexPartCreator{
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
Boundary cityBoundary = cityBoundaries.get(city);
|
Boundary cityBoundary = cityBoundaries.get(city);
|
||||||
if (cityBoundary != null) {
|
if (cityBoundary != null) {
|
||||||
for(City subpart : boundariesToCities.get(cityBoundary)){
|
List<City> subcities = boundariesToCities.get(cityBoundary);
|
||||||
|
if (subcities != null) {
|
||||||
|
for (City subpart : subcities) {
|
||||||
if (subpart != city) {
|
if (subpart != city) {
|
||||||
Boundary subBoundary = cityBoundaries.get(subpart);
|
Boundary subBoundary = cityBoundaries.get(subpart);
|
||||||
if (cityBoundary != null && subBoundary != null && subBoundary.getAdminLevel() > cityBoundary.getAdminLevel()) {
|
if (cityBoundary != null && subBoundary != null && subBoundary.getAdminLevel() > cityBoundary.getAdminLevel()) {
|
||||||
|
@ -613,6 +615,7 @@ public class IndexAddressCreator extends AbstractIndexPartCreator{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
Boundary b = cityBoundaries.get(city);
|
Boundary b = cityBoundaries.get(city);
|
||||||
cityPart = findNearestCityOrSuburb(b, location);
|
cityPart = findNearestCityOrSuburb(b, location);
|
||||||
|
|
Loading…
Reference in a new issue