diff --git a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java index 7781629d..d95d3f68 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java @@ -536,13 +536,18 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas final Location destination = dirTxt != null ? new Location(LocationType.ANY, null, null, dirTxt) : null; - final JSONArray stopList = jny.getJSONArray("stopL"); - checkState(stopList.length() >= 2); - final List intermediateStops = new ArrayList<>(stopList.length()); - for (int iStop = 1; iStop < stopList.length() - 1; iStop++) { - final JSONObject stop = stopList.getJSONObject(iStop); - final Stop intermediateStop = parseJsonStop(stop, locList, c, baseDate); - intermediateStops.add(intermediateStop); + final JSONArray stopList = jny.optJSONArray("stopL"); + final List intermediateStops; + if (stopList != null) { + checkState(stopList.length() >= 2); + intermediateStops = new ArrayList<>(stopList.length()); + for (int iStop = 1; iStop < stopList.length() - 1; iStop++) { + 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");