Changeset 18354 in josm for trunk


Ignore:
Timestamp:
2022-01-02T19:56:59+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #21694 - fix IOOBE in MapPaintMenu.toggleStyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java

    r16563 r18354  
    4646
    4747        private void toggleStyle() {
    48             MapPaintStyles.toggleStyleActive(MapPaintStyles.getStyles().getStyleSources().indexOf(style));
     48            int index = MapPaintStyles.getStyles().getStyleSources().indexOf(style);
     49            if (index >= 0) {
     50                MapPaintStyles.toggleStyleActive(index);
     51            }
    4952            updateButton();
    5053        }
Note: See TracChangeset for help on using the changeset viewer.