From aae93617436324d7532dcd278f3aa6547615c931 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Sun, 18 Nov 2018 16:57:12 +0100 Subject: [PATCH] OeffiMapView: Fix NullPointerException. --- oeffi/src/de/schildbach/oeffi/OeffiMapView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/oeffi/src/de/schildbach/oeffi/OeffiMapView.java b/oeffi/src/de/schildbach/oeffi/OeffiMapView.java index 9ecd5f9..c54a4ac 100644 --- a/oeffi/src/de/schildbach/oeffi/OeffiMapView.java +++ b/oeffi/src/de/schildbach/oeffi/OeffiMapView.java @@ -613,9 +613,12 @@ public class OeffiMapView extends MapView { // 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())); - if (points.size() >= 16) - break; + final Location location = station.location; + if (location.hasCoord()) { + points.add(new GeoPoint(location.getLatAsDouble(), location.getLonAsDouble())); + if (points.size() >= 16) + break; + } } // make sure a minimum area is shown