Bug: GPXExporter - TrackPoint of type SEGMENT_START_AUTOMATIC might have no location.

Fixes #1647.
This commit is contained in:
Dennis Guse
2023-08-03 19:31:10 +02:00
parent 0ecf4863a7
commit c254a6ec75
@@ -151,8 +151,12 @@ public class GPXTrackExporter implements TrackExporter {
if (wroteSegment) writeCloseSegment();
writeOpenSegment();
wroteSegment = true;
trackDistance = trackDistance.plus(writeTrackPoint(track.getZoneOffset(), trackPoint, sensorPoints, trackDistance));
sensorPoints.clear();
if (trackPoint.hasLocation()) {
trackDistance = trackDistance.plus(writeTrackPoint(track.getZoneOffset(), trackPoint, sensorPoints, trackDistance));
sensorPoints.clear();
} else {
sensorPoints.add(trackPoint);
}
}
case SENSORPOINT -> sensorPoints.add(trackPoint);
case TRACKPOINT -> {