mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 08:19:50 +00:00
Fix crash when parsing certain locations without coordinates (EFA).
This commit is contained in:
parent
00b0f014ca
commit
83d42d070d
1 changed files with 5 additions and 3 deletions
|
@ -2920,14 +2920,16 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
XmlPullUtil.optValueTag(pp, "a", null);
|
XmlPullUtil.optValueTag(pp, "a", null);
|
||||||
final Position position = new Position(XmlPullUtil.optValueTag(pp, "pl", null));
|
final Position position = new Position(XmlPullUtil.optValueTag(pp, "pl", null));
|
||||||
final String place = normalizeLocationName(XmlPullUtil.optValueTag(pp, "pc", null));
|
final String place = normalizeLocationName(XmlPullUtil.optValueTag(pp, "pc", null));
|
||||||
final Point coord = coordStrToPoint(XmlPullUtil.valueTag(pp, "c"));
|
final Point coord = coordStrToPoint(XmlPullUtil.optValueTag(pp, "c", null));
|
||||||
XmlPullUtil.exit(pp, "r");
|
XmlPullUtil.exit(pp, "r");
|
||||||
|
|
||||||
final Location location;
|
final Location location;
|
||||||
if (id.equals("99999997") || id.equals("99999998"))
|
if (id.equals("99999997") || id.equals("99999998"))
|
||||||
location = new Location(LocationType.ADDRESS, null, coord.lat, coord.lon, place, name);
|
location = new Location(LocationType.ADDRESS, null, coord != null ? coord.lat : 0, coord != null ? coord.lon : 0,
|
||||||
|
place, name);
|
||||||
else
|
else
|
||||||
location = new Location(LocationType.STATION, id, coord.lat, coord.lon, place, name);
|
location = new Location(LocationType.STATION, id, coord != null ? coord.lat : 0, coord != null ? coord.lon : 0,
|
||||||
|
place, name);
|
||||||
|
|
||||||
XmlPullUtil.exit(pp, "p");
|
XmlPullUtil.exit(pp, "p");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue