Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java	(revision 24032)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java	(revision 24033)
@@ -126,5 +126,5 @@
 			return;
 
-		start = new Date();
+		start = new Date();		
 		end = new Date(0L);
 		this.minHeight = Integer.MAX_VALUE;
@@ -136,4 +136,18 @@
 		for (WayPoint wayPoint : this.wayPoints) {
 			visit(wayPoint);
+		}
+		
+		if (this.minHeight == Integer.MAX_VALUE && this.maxHeight == Integer.MIN_VALUE) {
+			// file does not contain elevation data	at all
+			minHeight = 0;
+			maxHeight = 0;
+			setMinWayPoint(wayPoints.get(0));
+			setMaxWayPoint(wayPoints.get(n-1));
+		}		
+		
+		if (start.after(end) || start.equals(end)) {
+			// GPX does not contain time stamps -> use sequential order
+			setStart(wayPoints.get(0));
+			setEnd(wayPoints.get(n-1));
 		}
 		
