Changeset 13367 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2018-01-28T23:08:56+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #15332 - IndexOutOfBoundsException in ConflictDialog

File:
1 edited

Legend:

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

    r12987 r13367  
    208208            dialog.showDialog();
    209209
    210             lstConflicts.setSelectedIndex(index);
     210            if (index < conflicts.size() - 1) {
     211                lstConflicts.setSelectedIndex(index);
     212            } else {
     213                lstConflicts.setSelectedIndex(index - 1);
     214            }
    211215        }
    212216        MainApplication.getMap().mapView.repaint();
     
    304308        int index = lstConflicts.getSelectedIndex();
    305309
    306         return index >= 0 ? conflicts.get(index) : null;
     310        return index >= 0 && index < conflicts.size() ? conflicts.get(index) : null;
    307311    }
    308312
Note: See TracChangeset for help on using the changeset viewer.