Changeset 13986 in josm


Ignore:
Timestamp:
2018-06-30T11:15:20+02:00 (9 months ago)
Author:
Don-vip
Message:

fix #16442 - IndexOutOfBoundsException when deleting the last color entry in preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r13849 r13986  
    170170            deleted.add(data.get(row));
    171171            data.remove(row);
    172             fireTableDataChanged();
     172            fireTableRowsDeleted(row, row);
    173173        }
    174174
     
    440440    private void updateEnabledState() {
    441441        int sel = colors.getSelectedRow();
    442         ColorEntry ce = sel >= 0 ? tableModel.getEntry(sel) : null;
     442        ColorEntry ce = sel >= 0 && sel < tableModel.getRowCount() ? tableModel.getEntry(sel) : null;
    443443        remove.setEnabled(ce != null && isRemoveColor(ce));
    444444        colorEdit.setEnabled(ce != null);
Note: See TracChangeset for help on using the changeset viewer.