Changeset 11078 in josm for trunk/src


Ignore:
Timestamp:
2016-10-04T14:43:51+02:00 (3 years ago)
Author:
michael2402
Message:

Fix #13744: If a layer removal triggers the removal of an other layer (e.g. Validator), do not remove it twice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DeleteLayerAction.java

    r10600 r11078  
    4747            return;
    4848        for (Layer l: selectedLayers) {
    49             Main.getLayerManager().removeLayer(l);
     49            if (model.getLayerManager().containsLayer(l)) {
     50                // it may happen that this call removes other layers.
     51                // this is why we need to check if every layer is still in the list of selected layers.
     52                model.getLayerManager().removeLayer(l);
     53            }
    5054        }
    5155    }
Note: See TracChangeset for help on using the changeset viewer.