mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
avoid NPE in getEstimatedSpeed
This commit is contained in:
1 parent
58d711be88
commit
6c1faa5a0b
1 file changed
+3
-2
+3
-2
@@ -309,9 +309,10 @@ public class GPSFixTrackImpl<ItemType, FixType extends GPSFix> extends TrackImpl
|
||||
*/
|
||||
@Override
|
||||
public synchronized SpeedWithBearing getEstimatedSpeed(TimePoint at) {
|
||||
return getEstimatedSpeed(at, getInternalFixes(), ConfidenceFactory.INSTANCE.createExponentialTimeDifferenceWeigher(
|
||||
SpeedWithBearingWithConfidence<TimePoint> estimatedSpeed = getEstimatedSpeed(at, getInternalFixes(), ConfidenceFactory.INSTANCE.createExponentialTimeDifferenceWeigher(
|
||||
// use a minimum confidence to avoid the bearing to flip to 270deg in case all is zero
|
||||
getMillisecondsOverWhichToAverageSpeed())).getObject();
|
||||
getMillisecondsOverWhichToAverageSpeed()));
|
||||
return estimatedSpeed == null ? null : estimatedSpeed.getObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user