Ticket #23023: fix-color-buttons.patch

File fix-color-buttons.patch, 938 bytes (added by Larsossum, 20 months ago)

Patch for fixing the problem

  • src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

     
    441441
    442442    private void updateEnabledState() {
    443443        int sel = colors.getSelectedRow();
    444         if (sel < 0 || sel >= colors.getRowCount()) {
    445             return;
     444        ColorEntry ce;
     445        if (sel >= 0 && sel < colors.getRowCount()) {
     446            ce = (ColorEntry) colors.getValueAt(sel, 0);
     447        } else {
     448            ce = null;
    446449        }
    447         ColorEntry ce = (ColorEntry) colors.getValueAt(sel, 0);
    448450        remove.setEnabled(ce != null && isRemoveColor(ce));
    449451        colorEdit.setEnabled(ce != null);
    450452        defaultSet.setEnabled(ce != null && !ce.isDefault());