mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 18:28:47 +00:00
AbstractHafasClientInterfaceProvider: Handle missing 'stopL' when querying trips.
This commit is contained in:
parent
96477de706
commit
d2fe93b16a
1 changed files with 12 additions and 7 deletions
|
@ -536,13 +536,18 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
final Location destination = dirTxt != null ? new Location(LocationType.ANY, null, null, dirTxt)
|
final Location destination = dirTxt != null ? new Location(LocationType.ANY, null, null, dirTxt)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final JSONArray stopList = jny.getJSONArray("stopL");
|
final JSONArray stopList = jny.optJSONArray("stopL");
|
||||||
checkState(stopList.length() >= 2);
|
final List<Stop> intermediateStops;
|
||||||
final List<Stop> intermediateStops = new ArrayList<>(stopList.length());
|
if (stopList != null) {
|
||||||
for (int iStop = 1; iStop < stopList.length() - 1; iStop++) {
|
checkState(stopList.length() >= 2);
|
||||||
final JSONObject stop = stopList.getJSONObject(iStop);
|
intermediateStops = new ArrayList<>(stopList.length());
|
||||||
final Stop intermediateStop = parseJsonStop(stop, locList, c, baseDate);
|
for (int iStop = 1; iStop < stopList.length() - 1; iStop++) {
|
||||||
intermediateStops.add(intermediateStop);
|
final JSONObject stop = stopList.getJSONObject(iStop);
|
||||||
|
final Stop intermediateStop = parseJsonStop(stop, locList, c, baseDate);
|
||||||
|
intermediateStops.add(intermediateStop);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
intermediateStops = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final JSONArray remList = jny.optJSONArray("remL");
|
final JSONArray remList = jny.optJSONArray("remL");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue