diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2015-03-08 15:30:29 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2015-03-08 15:30:29 +0100 |
commit | b6140ee20f1a74c580208c3f513954a13b7aa572 (patch) | |
tree | 4abc4a4756d75e3fe6d3edddb9bf335f8acf1152 /main/src/cgeo/geocaching/maps/CGeoMap.java | |
parent | d6e1af982ec3d7b3c3003aaf3898838edae2f5c4 (diff) | |
download | cgeo-b6140ee20f1a74c580208c3f513954a13b7aa572.zip cgeo-b6140ee20f1a74c580208c3f513954a13b7aa572.tar.gz cgeo-b6140ee20f1a74c580208c3f513954a13b7aa572.tar.bz2 |
fix CME in accessing single cache on map
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CGeoMap.java')
-rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 3 |
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; } |