Index: src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 18770)
+++ src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(working copy)
@@ -441,10 +441,12 @@
 
     private void updateEnabledState() {
         int sel = colors.getSelectedRow();
-        if (sel < 0 || sel >= colors.getRowCount()) {
-            return;
+        ColorEntry ce;
+        if (sel >= 0 && sel < colors.getRowCount()) {
+            ce = (ColorEntry) colors.getValueAt(sel, 0);
+        } else {
+            ce = null;
         }
-        ColorEntry ce = (ColorEntry) colors.getValueAt(sel, 0);
         remove.setEnabled(ce != null && isRemoveColor(ce));
         colorEdit.setEnabled(ce != null);
         defaultSet.setEnabled(ce != null && !ce.isDefault());
