aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-01-13 10:26:38 +0100
committerBananeweizen <bananeweizen@gmx.de>2013-01-13 10:26:38 +0100
commit89bd78c4e3233788a3910443b1d7de3d2857c7c6 (patch)
tree7f1ea2309353d887b447515873d25a55dfd28f6a
parentea9ec5698f652f648d4e93eede50d385a56509c7 (diff)
downloadcgeo-89bd78c4e3233788a3910443b1d7de3d2857c7c6.zip
cgeo-89bd78c4e3233788a3910443b1d7de3d2857c7c6.tar.gz
cgeo-89bd78c4e3233788a3910443b1d7de3d2857c7c6.tar.bz2
fix #2391: NPE in map
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 6856a63..e48ca70 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -495,9 +495,11 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
if (!CollectionUtils.isEmpty(dirtyCaches)) {
for (String geocode : dirtyCaches) {
cgCache cache = app.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS);
- // remove to update the cache
- caches.remove(cache);
- caches.add(cache);
+ if (cache != null) {
+ // remove to update the cache
+ caches.remove(cache);
+ caches.add(cache);
+ }
}
dirtyCaches.clear();
// Update display