Changeset 6078 in josm


Ignore:
Timestamp:
2013-07-20T22:26:27+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #8894 - IndexOutOfBoundsException opening tagging preset selector without any preset matching the current selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java

    r6074 r6078  
    197197    }
    198198
     199    /**
     200     * Constructs a new {@code TaggingPresetSelector}.
     201     */
    199202    public TaggingPresetSelector() {
    200203        super(new BorderLayout());
     
    430433     */
    431434    public TaggingPreset getSelectedPreset() {
     435        List<PresetClassification> presets = lsResultModel.getPresets();
     436        if (presets.isEmpty()) return null;
    432437        int idx = lsResult.getSelectedIndex();
    433438        if (idx == -1) {
    434439            idx = 0;
    435440        }
    436         TaggingPreset preset = lsResultModel.getPresets().get(idx).preset;
     441        TaggingPreset preset = presets.get(idx).preset;
    437442        for (PresetClassification pc: classifications) {
    438443            if (pc.preset == preset) {
Note: See TracChangeset for help on using the changeset viewer.