mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 14:48:49 +00:00
AbstractEfaProvider: add exception message of string coordinate can't be parsed
This commit is contained in:
parent
dfcc152516
commit
36bc759742
1 changed files with 4 additions and 0 deletions
|
@ -2801,6 +2801,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
final String[] coordParts = coordPart.split(":");
|
final String[] coordParts = coordPart.split(":");
|
||||||
final String mapName = coordParts[2];
|
final String mapName = coordParts[2];
|
||||||
if (COORD_FORMAT.equals(mapName)) {
|
if (COORD_FORMAT.equals(mapName)) {
|
||||||
|
if (coordParts.length < 2)
|
||||||
|
throw new RuntimeException("cannot parse coordinate: " + coordPart);
|
||||||
final double lat = Double.parseDouble(coordParts[1]);
|
final double lat = Double.parseDouble(coordParts[1]);
|
||||||
final double lon = Double.parseDouble(coordParts[0]);
|
final double lon = Double.parseDouble(coordParts[0]);
|
||||||
coords = Point.fromDouble(lat, lon);
|
coords = Point.fromDouble(lat, lon);
|
||||||
|
@ -2942,6 +2944,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
final String[] parts = coordStr.split(",");
|
final String[] parts = coordStr.split(",");
|
||||||
|
if (parts.length < 2)
|
||||||
|
throw new RuntimeException("cannot parse coordinate: " + coordStr);
|
||||||
final double lat = Double.parseDouble(parts[1]);
|
final double lat = Double.parseDouble(parts[1]);
|
||||||
final double lon = Double.parseDouble(parts[0]);
|
final double lon = Double.parseDouble(parts[0]);
|
||||||
return Point.fromDouble(lat, lon);
|
return Point.fromDouble(lat, lon);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue