mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 17:39:49 +00:00
Hafas: Fix crash when JSON trips query doesn't return a distance.
This commit is contained in:
parent
577d619a17
commit
62a5a54d73
1 changed files with 1 additions and 1 deletions
|
@ -1258,7 +1258,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
else if ("WALK".equals(secType) || "TRSF".equals(secType))
|
||||
{
|
||||
final JSONObject gis = sec.getJSONObject("gis");
|
||||
final int distance = gis.getInt("dist");
|
||||
final int distance = gis.optInt("dist", 0);
|
||||
leg = new Trip.Individual(Trip.Individual.Type.WALK, departureStop.location, departureStop.getDepartureTime(),
|
||||
arrivalStop.location, arrivalStop.getArrivalTime(), null, distance);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue