mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-10 19:48:49 +00:00
OeffiMapView: Fix NullPointerException.
This commit is contained in:
parent
f8b7003f5e
commit
aae9361743
1 changed files with 6 additions and 3 deletions
|
@ -613,9 +613,12 @@ public class OeffiMapView extends MapView {
|
||||||
// show at most 16 stations
|
// show at most 16 stations
|
||||||
final List<GeoPoint> points = new LinkedList<>();
|
final List<GeoPoint> points = new LinkedList<>();
|
||||||
for (final Station station : stations) {
|
for (final Station station : stations) {
|
||||||
points.add(new GeoPoint(station.location.getLatAsDouble(), station.location.getLonAsDouble()));
|
final Location location = station.location;
|
||||||
if (points.size() >= 16)
|
if (location.hasCoord()) {
|
||||||
break;
|
points.add(new GeoPoint(location.getLatAsDouble(), location.getLonAsDouble()));
|
||||||
|
if (points.size() >= 16)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure a minimum area is shown
|
// make sure a minimum area is shown
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue