aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-06-07 09:19:55 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-06-07 09:19:55 +0200
commit00ebf4407eb0797e6f57cb1644f416e3251f253d (patch)
treedbc4055a865fd4cce8e738d88a1bdd5a36123ccd /main/src/cgeo/geocaching
parent5d6547e13a55b802fdb0ea142526bc57cf62e1ae (diff)
downloadcgeo-00ebf4407eb0797e6f57cb1644f416e3251f253d.zip
cgeo-00ebf4407eb0797e6f57cb1644f416e3251f253d.tar.gz
cgeo-00ebf4407eb0797e6f57cb1644f416e3251f253d.tar.bz2
Fix #1736: some caches can be null
Due to the fragile concurrent updates, some caches can be null. Check against it, and do the same thing for waypoints.
Diffstat (limited to 'main/src/cgeo/geocaching')
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index f6a5a8b..8b5fe18 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -1209,7 +1209,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
if (cachesToDisplay.size() == 1 || (cachesCnt < Settings.getWayPointsThreshold())) {
for (cgWaypoint waypoint : waypointsToDisplay) {
- if (waypoint.getCoords() == null) {
+ if (waypoint == null || waypoint.getCoords() == null) {
continue;
}
@@ -1218,7 +1218,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
}
for (cgCache cache : cachesToDisplay) {
- if (cache.getCoords() == null) {
+ if (cache == null || cache.getCoords() == null) {
continue;
}
itemsToDisplay.add(getItem(cache, cache, null));