Fix NPE of POI empty creation

This commit is contained in:
Victor Shcherb 2011-12-26 15:46:04 +01:00
parent 872efc0679
commit ba5b9892c3

View file

@ -95,7 +95,7 @@ public class IndexPoiCreator extends AbstractIndexPartCreator {
Algoritms.removeAllFiles(poiIndexFile); Algoritms.removeAllFiles(poiIndexFile);
} }
private void checkEntity(Entity e) { public void checkEntity(Entity e) {
String name = e.getTag(OSMTagKey.NAME); String name = e.getTag(OSMTagKey.NAME);
if (name == null) { if (name == null) {
String msg = ""; String msg = "";
@ -548,9 +548,11 @@ public class IndexPoiCreator extends AbstractIndexPartCreator {
} }
} else { } else {
int sum = 0; int sum = 0;
if (subtrees != null) {
for (Tree<T> t : subtrees) { for (Tree<T> t : subtrees) {
sum += t.getSubTreesOnLevel(level - 1); sum += t.getSubTreesOnLevel(level - 1);
} }
}
return sum; return sum;
} }
} }