Index: src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java
===================================================================
--- src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java	(revision 34864)
+++ src/org/openstreetmap/josm/plugins/elevation/gpx/ElevationProfile.java	(working copy)
@@ -1,6 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.elevation.gpx;
-+
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -9,8 +9,8 @@
 import org.openstreetmap.josm.data.gpx.WayPoint;
 import org.openstreetmap.josm.plugins.elevation.ElevationHelper;
 import org.openstreetmap.josm.plugins.elevation.IElevationProfile;
-
 
+
 /**
  * Base class for an elevation profile. An elevation profile is constructed out
  * of a set of way points. The profile computes min/max/average height from the
@@ -377,14 +377,17 @@
      */
     @Override
     public void visitWayPoint(WayPoint wp) {
-        if (wp.getDate().after(end)) {
-            setEnd(wp);
-        }
+        if (wp == null)
+            return;
+        if (wp.getDate() != null) {
+            if (wp.getDate().after(end)) {
+                setEnd(wp);
+            }
 
-        if (wp.getDate().before(start)) {
-            setStart(wp);
+            if (wp.getDate().before(start)) {
+                setStart(wp);
+            }
         }
-
         // update boundaries
         if (bounds == null) {
             bounds = new Bounds(wp.getCoor());
