mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 21:43:49 +00:00
fixed NullPointerE that occured when track was empty
This commit is contained in:
1 parent
69b10da77e
commit
dea531e6d0
1 file changed
+3
+3
@@ -308,6 +308,9 @@ public class TrackImpl<FixType extends Timed> implements Track<FixType> {
|
||||
@Override
|
||||
public Duration getAverageIntervalBetweenFixes() {
|
||||
lockForRead();
|
||||
if (getFixes().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return getFixes().first().getTimePoint().until(getFixes().last().getTimePoint()).divide(getFixes().size()-1);
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user