AbstractEfaProvider: handle missing/invalid coordinate in <coordInfoItem>

This commit is contained in:
Andreas Schildbach 2024-05-03 12:14:25 +02:00
parent 295cbdc3c8
commit 678f235d16

View file

@ -523,7 +523,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
// FIXME this is always only one coordinate
final List<Point> path = processItdPathCoordinates(pp);
final Point coord1 = path != null ? path.get(0) : null;
if (path != null) {
final Point coord1 = path.get(0);
EnumSet<Product> products = null;
if (XmlPullUtil.optEnter(pp, "genAttrList")) {
@ -542,12 +543,13 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
XmlPullUtil.skipExit(pp, "genAttrList");
}
XmlPullUtil.skipExit(pp, "coordInfoItem");
if (name != null)
locations.add(new Location(locationType, id, coord1, place, name, products));
}
XmlPullUtil.skipExit(pp, "coordInfoItem");
}
XmlPullUtil.skipExit(pp, "coordInfoItemList");
}