Fix small bug

This commit is contained in:
Alexander Sytnyk 2018-03-17 15:39:52 +02:00
parent c582434499
commit cdcab890e7

View file

@ -614,13 +614,14 @@ public class MapMarkersHelper {
private void removeActiveMarkersFromSyncGroup(String syncGroupId) { private void removeActiveMarkersFromSyncGroup(String syncGroupId) {
if (syncGroupId != null) { if (syncGroupId != null) {
markersDbHelper.removeActiveMarkersFromSyncGroup(syncGroupId); markersDbHelper.removeActiveMarkersFromSyncGroup(syncGroupId);
List<MapMarker> newList = new ArrayList<>();
List<MapMarker> copyList = new ArrayList<>(mapMarkers); List<MapMarker> copyList = new ArrayList<>(mapMarkers);
for (MapMarker marker : copyList) { for (MapMarker marker : copyList) {
if (marker.groupKey == null || !marker.groupKey.equals(syncGroupId)) { if (marker.groupKey == null || !marker.groupKey.equals(syncGroupId)) {
copyList.add(marker); newList.add(marker);
} }
} }
mapMarkers = copyList; mapMarkers = newList;
reorderActiveMarkersIfNeeded(); reorderActiveMarkersIfNeeded();
refresh(); refresh();
} }