X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FSpeedCalculator.java;h=e80e21498e6b3ffa04e3b30b3a959854a5d2563b;hp=f6f429c7d477bc13cb29a5a9bb3212e467e99fcf;hb=a6197ddcaac11c0b943183da7d46169742d024af;hpb=88f2c3647ed9e055090484f01a959d4581f85e7d diff --git a/tim/prune/data/SpeedCalculator.java b/tim/prune/data/SpeedCalculator.java index f6f429c..e80e214 100644 --- a/tim/prune/data/SpeedCalculator.java +++ b/tim/prune/data/SpeedCalculator.java @@ -16,11 +16,12 @@ public abstract class SpeedCalculator */ public static void calculateSpeed(Track inTrack, int inIndex, SpeedValue inValue) { - if (inTrack == null || inIndex < 0 || inValue == null) { + inValue.setInvalid(); + if (inTrack == null || inIndex < 0 || inValue == null) + { System.err.println("Cannot calculate speed for index " + inIndex); return; } - inValue.setInvalid(); DataPoint point = inTrack.getPoint(inIndex); if (point == null) {return;}