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; 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 { throws XmlPullParserException, IOException {
final List<Point> path = new LinkedList<>(); final List<Point> path = new LinkedList<>();
final String value = XmlPullUtil.valueTag(pp, tag); final String value = XmlPullUtil.optValueTag(pp, tag, null);
for (final String coordStr : value.split(" +")) if (value != null) {
path.add(parseCoord(coordStr)); for (final String coordStr : value.split(" +"))
path.add(parseCoord(coordStr));
return path; return path;
} else {
return null;
}
} }
private List<Point> processCoordinateBaseElems(final XmlPullParser pp) throws XmlPullParserException, IOException { private List<Point> processCoordinateBaseElems(final XmlPullParser pp) throws XmlPullParserException, IOException {