mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 14:27:15 +00:00
fixing bug 3040 by adding null handling in TrackedLegOfCompetitorImpl.getAverageVelocityMadeGood
This commit is contained in:
1 parent
51f7facf47
commit
10bb214083
1 file changed
+6
-4
+6
-4
@@ -340,10 +340,12 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
|
||||
}
|
||||
final Position endPos = getTrackedRace().getTrack(getCompetitor()).getEstimatedPosition(to, /* extrapolate */false);
|
||||
if (endPos != null) {
|
||||
Distance d = getTrackedLeg().getAbsoluteWindwardDistance(
|
||||
getTrackedRace().getTrack(getCompetitor()).getEstimatedPosition(start.getTimePoint(), false),
|
||||
endPos, to, WindPositionMode.EXACT, cache);
|
||||
result = d.inTime(to.asMillis() - start.getTimePoint().asMillis());
|
||||
final Position startPos = getTrackedRace().getTrack(getCompetitor()).getEstimatedPosition(start.getTimePoint(), false);
|
||||
if (startPos != null) {
|
||||
Distance d = getTrackedLeg().getAbsoluteWindwardDistance(startPos, endPos, to,
|
||||
WindPositionMode.EXACT, cache);
|
||||
result = d.inTime(to.asMillis() - start.getTimePoint().asMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user