From aa445c460e9b8d000d0f7a54fb2d80d3df0c8e3e Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Fri, 16 Nov 2018 23:50:44 +0100 Subject: [PATCH] OeffiMapView: Prevent IndexOutOfBoundsException. --- oeffi/src/de/schildbach/oeffi/OeffiMapView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oeffi/src/de/schildbach/oeffi/OeffiMapView.java b/oeffi/src/de/schildbach/oeffi/OeffiMapView.java index b6969c3..9ecd5f9 100644 --- a/oeffi/src/de/schildbach/oeffi/OeffiMapView.java +++ b/oeffi/src/de/schildbach/oeffi/OeffiMapView.java @@ -607,7 +607,10 @@ public class OeffiMapView extends MapView { } public void zoomToStations(final List stations) { - // show at least 16 stations + if (stations.isEmpty()) + return; + + // show at most 16 stations final List points = new LinkedList<>(); for (final Station station : stations) { points.add(new GeoPoint(station.location.getLatAsDouble(), station.location.getLonAsDouble()));