Bugfix: crash on recording start due to show latitude/longitude option.

Fixes #613.
This commit is contained in:
Dennis Guse
2021-02-27 18:37:42 +01:00
parent eac7efba64
commit 4040e3f45b
3 changed files with 26 additions and 26 deletions
@@ -38,7 +38,6 @@ public class LocationUtils {
/**
* Checks if a given location is a valid (i.e. physically possible) location on Earth.
* Neither will locations with lat=0 and lng=0 as these are most likely "bad" measurements which often cause trouble.
*
* @param location the location to test
* @return true if the location is a valid location.
@@ -50,8 +49,9 @@ public class LocationUtils {
}
public static boolean isTrackPointOld(TrackPoint trackPoint) {
return Duration.between(trackPoint.getTime(), Instant.now())
Instant now = Instant.now();
return !(Duration.between(trackPoint.getTime(), now)
.minus(MAX_LOCATION_AGE)
.isNegative();
.isNegative());
}
}