fixed NullPointerE that occured when track was empty

This commit is contained in:
Fredrik Teschke committed 2014-03-07 18:15:26 +01:00
1 parent 69b10da77e
commit dea531e6d0
1 file changed
+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 {