Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 11506)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 11508)
@@ -7,4 +7,5 @@
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Dimension;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionListener;
@@ -281,9 +282,17 @@
 
         colorTypeHeatMapTune.addPropertyChangeListener(e -> {
-            // get image size of environment
-            final int iconSize = (int) colorTypeHeatMapTune.getPreferredSize().getHeight();
-            // ask the GPX draw for the correct color of that layer
-            final Color color = GpxDrawHelper.DEFAULT_COLOR.getChildColor(layerName != null ? layerName : "").get();
-            colorTypeHeatIconLabel.setIcon(GpxDrawHelper.getColorMapImageIcon(color, colorTypeHeatMapTune.getSelectedIndex(), iconSize));
+            final Dimension dim = colorTypeHeatMapTune.getPreferredSize();
+            if (null != dim) {
+                // get image size of environment
+                final int iconSize = (int) dim.getHeight();
+                final Color color;
+                // ask the GPX draw for the correct color of that layer ( if there is one )
+                if (null != layerName) {
+                    color = GpxDrawHelper.DEFAULT_COLOR.getChildColor(layerName).get();
+                } else {
+                    color = GpxDrawHelper.DEFAULT_COLOR.getDefaultValue();
+                }
+                colorTypeHeatIconLabel.setIcon(GpxDrawHelper.getColorMapImageIcon(color, colorTypeHeatMapTune.getSelectedIndex(), iconSize));
+            }
         });
 
