diff --git a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java index 1d0edd10..1047f192 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasClientInterfaceProvider.java @@ -434,16 +434,20 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas if (location.hasId()) return location; if (location.hasName()) { - final List locations = jsonLocMatch(JOINER.join(location.place, location.name), null, 1) - .getLocations(); - if (!locations.isEmpty()) - return locations.get(0); + final SuggestLocationsResult result = jsonLocMatch(JOINER.join(location.place, location.name), null, 1); + if (result.status == SuggestLocationsResult.Status.OK) { + final List locations = result.getLocations(); + if (!locations.isEmpty()) + return locations.get(0); + } } if (location.hasCoord()) { - final List locations = jsonLocGeoPos(EnumSet.allOf(LocationType.class), location.coord, 0, - 1).locations; - if (!locations.isEmpty()) - return locations.get(0); + final NearbyLocationsResult result = jsonLocGeoPos(EnumSet.allOf(LocationType.class), location.coord, 0, 1); + if (result.status == NearbyLocationsResult.Status.OK) { + final List locations = result.locations; + if (!locations.isEmpty()) + return locations.get(0); + } } return null; }