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