forked from upstream-mirrors/OpenTracks
Bugfix: prevent crash when creating TRACKPOINT without location.
Introduced in 2f0449c420
This commit is contained in:
@@ -172,13 +172,14 @@ public class TrackStatisticsUpdater {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!trackPoint.hasSensorDistance()) {
|
||||
if (!trackPoint.hasSensorDistance()
|
||||
&& trackPoint.hasLocation() && lastMovingTrackPoint.hasLocation()) {
|
||||
// GPS-based distance/speed
|
||||
Distance movingDistance = trackPoint.distanceToPrevious(lastMovingTrackPoint);
|
||||
if (movingDistance.lessThan(minGPSDistance) && !trackPoint.isMoving()) {
|
||||
if (movingDistance != null && movingDistance.lessThan(minGPSDistance) && !trackPoint.isMoving()) {
|
||||
speedBuffer_mps.reset();
|
||||
lastTrackPoint = trackPoint;
|
||||
return;
|
||||
return; //TOOD Why? Is there nothing to be done afterwards?
|
||||
}
|
||||
// Update total distance
|
||||
currentSegment.addTotalDistance(movingDistance);
|
||||
|
||||
Reference in New Issue
Block a user