Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 19236)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 19238)
@@ -241,5 +241,4 @@
     /** maxTime saves the end time of the track as epoch seconds */
     private double maxTime;
-
 
     private void setupColors() {
Index: trunk/src/org/openstreetmap/josm/tools/ColorScale.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ColorScale.java	(revision 19236)
+++ trunk/src/org/openstreetmap/josm/tools/ColorScale.java	(revision 19238)
@@ -14,4 +14,5 @@
 import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.preferences.NamedColorProperty;
@@ -205,4 +206,5 @@
      */
     public ColorScale addTitle(String title) {
+        Objects.requireNonNull(title);
         this.title = title;
         return this;
@@ -325,8 +327,6 @@
 
         // legend title
-        if (title != null) {
-            g.setColor(LEGEND_TITLE);
-            g.drawString(title, xRect + rectWidth / 2 - titleWidth / 2, y - fh * 3 / 2 - 10);
-        }
+        g.setColor(LEGEND_TITLE);
+        g.drawString(title, xRect + rectWidth / 2 - titleWidth / 2, y - fh * 3 / 2 - 10);
 
         // legend texts
@@ -385,8 +385,6 @@
 
         // legend title
-        if (title != null) {
-            g.setColor(LEGEND_TITLE);
-            g.drawString(title, xRect + rectWidth / 2 - titleWidth / 2, y - fh * 3 / 2 - padding / 2);
-        }
+        g.setColor(LEGEND_TITLE);
+        g.drawString(title, xRect + rectWidth / 2 - titleWidth / 2, y - fh * 3 / 2 - padding / 2);
 
         // legend texts
