Changeset 16790 in josm


Ignore:
Timestamp:
2020-07-17T23:52:59+02:00 (3 weeks ago)
Author:
simon04
Message:

fix #19476 - IndexOutOfBoundsException in ActivateLayerAction.actionPerformed

File:
1 edited

Legend:

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

    r12799 r16790  
    7171            toActivate = layer;
    7272        } else {
    73             toActivate = model.getSelectedLayers().get(0);
     73            List<Layer> layers = model.getSelectedLayers();
     74            if (layers.isEmpty()) {
     75                // see #19476 for a possible cause
     76                return;
     77            }
     78            toActivate = layers.get(0);
    7479        }
    7580        execute(toActivate);
Note: See TracChangeset for help on using the changeset viewer.