diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2015-09-26 13:08:01 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2015-09-26 13:08:01 +0200 |
commit | b1876d5bb11c5da2264dec949ff22270ddc2386e (patch) | |
tree | 3baeca8ba7d0bf6dafae7b0326e22c5fd22f1748 | |
parent | 70d4a7c38f793041a14da1e485f83d530b4a7add (diff) | |
download | cgeo-b1876d5bb11c5da2264dec949ff22270ddc2386e.zip cgeo-b1876d5bb11c5da2264dec949ff22270ddc2386e.tar.gz cgeo-b1876d5bb11c5da2264dec949ff22270ddc2386e.tar.bz2 |
fix #5204: crash invoking maps.me for waypoint without coords
-rw-r--r-- | main/res/values/changelog_release.xml | 4 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/apps/navi/MapsMeApp.java | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/main/res/values/changelog_release.xml b/main/res/values/changelog_release.xml index 802de61..a18f3d9 100644 --- a/main/res/values/changelog_release.xml +++ b/main/res/values/changelog_release.xml @@ -2,6 +2,10 @@ <resources> <!-- changelog for the release branch --> <string name="changelog_release" translatable="false">\n + <b>Next release</b>\n + · Fix: Crash invoking Maps.me with waypoints without coordinates\n + \n + \n <b>2015.09.23:</b>\n · New: Redesign of cache overlay icons\n · New: Alignment of cache icons on list and map\n diff --git a/main/src/cgeo/geocaching/apps/navi/MapsMeApp.java b/main/src/cgeo/geocaching/apps/navi/MapsMeApp.java index 7e02398..75cda1d 100644 --- a/main/src/cgeo/geocaching/apps/navi/MapsMeApp.java +++ b/main/src/cgeo/geocaching/apps/navi/MapsMeApp.java @@ -40,7 +40,10 @@ class MapsMeApp extends AbstractPointNavigationApp { final ArrayList<MWMPoint> points = new ArrayList<>(); points.add(new MWMPoint(cache.getCoords().getLatitude(), cache.getCoords().getLongitude(), cache.getName())); for (final Waypoint waypoint : cache.getWaypoints()) { - points.add(new MWMPoint(waypoint.getCoords().getLatitude(), waypoint.getCoords().getLongitude(), waypoint.getName(), waypoint.getGeocode())); + final Geopoint coords = waypoint.getCoords(); + if (coords != null) { + points.add(new MWMPoint(coords.getLatitude(), coords.getLongitude(), waypoint.getName(), waypoint.getGeocode())); + } } final MWMPoint[] pointsArray = points.toArray(new MWMPoint[points.size()]); MapsWithMeApi.showPointsOnMap(activity, cache.getName(), pointsArray); |