aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 6b1c23c..c808ffd 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -265,7 +265,8 @@ public class CGeoMap extends AbstractMap implements ViewFactory {
@Nullable
private Geocache getSingleModeCache() {
- for (final Geocache geocache : caches) {
+ // use a copy of the caches list to avoid concurrent modification
+ for (final Geocache geocache : new ArrayList<>(caches)) {
if (geocache.getGeocode().equals(geocodeIntent)) {
return geocache;
}