Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java	(revision 35065)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java	(revision 35066)
@@ -10,4 +10,5 @@
 import org.openstreetmap.josm.plugins.elevation.ElevationHelper;
 import org.openstreetmap.josm.plugins.elevation.IElevationProfile;
+import org.openstreetmap.josm.tools.Logging;
 
 
@@ -305,5 +306,11 @@
 
         if (wp1 != null && wp2 != null) {
-            return wp2.getDate().getTime() - wp1.getDate().getTime();
+            Date wp1Date = wp1.getDate();
+            Date wp2Date = wp2.getDate();
+            if (wp1Date != null && wp2Date != null) {
+                return wp2Date.getTime() - wp1Date.getTime();
+            } else {
+                Logging.warn("Waypoints without date: " + wp1 + " / " + wp2);
+            }
         }
 
