AbstractEfaProvider: Make processCoordinateStrings() to return null if there is no coordinate string.

This commit is contained in:
Andreas Schildbach 2017-09-12 13:59:20 +02:00
parent e179351115
commit a3e95ddab2

View file

@ -2879,15 +2879,18 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
return path;
}
private List<Point> processCoordinateStrings(final XmlPullParser pp, final String tag)
private @Nullable List<Point> processCoordinateStrings(final XmlPullParser pp, final String tag)
throws XmlPullParserException, IOException {
final List<Point> path = new LinkedList<>();
final String value = XmlPullUtil.valueTag(pp, tag);
for (final String coordStr : value.split(" +"))
path.add(parseCoord(coordStr));
return path;
final String value = XmlPullUtil.optValueTag(pp, tag, null);
if (value != null) {
for (final String coordStr : value.split(" +"))
path.add(parseCoord(coordStr));
return path;
} else {
return null;
}
}
private List<Point> processCoordinateBaseElems(final XmlPullParser pp) throws XmlPullParserException, IOException {