diff --git a/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java b/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java index cd99b1d3..3dc6d8f7 100644 --- a/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java +++ b/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java @@ -1017,15 +1017,20 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas private List parseLocList(final JSONArray locList, final JSONArray crdSysList) throws JSONException { final List locations = new ArrayList<>(locList.length()); - for (int iLoc = 0; iLoc < locList.length(); iLoc++) - locations.add(parseLoc(locList, iLoc, new HashSet(), crdSysList)); + for (int iLoc = 0; iLoc < locList.length(); iLoc++) { + final Location location = parseLoc(locList, iLoc, new HashSet(), crdSysList); + if (location != null) + locations.add(location); + } return locations; } private Location parseLoc(final JSONArray locList, final int locListIndex, @Nullable Set previousLocListIndexes, final JSONArray crdSysList) throws JSONException { final JSONObject loc = locList.getJSONObject(locListIndex); - final String type = loc.getString("type"); + final String type = loc.optString("type", null); + if (type == null) + return null; final LocationType locationType; final String id;