Live races ui - Fixed race progress if no leg is started

This commit is contained in:
Benjamin Barth committed 2015-05-20 17:24:49 +02:00
1 parent 8098cdbcaa
commit e7b6d4c911
1 file changed
+3 -1
@@ -191,7 +191,9 @@ public class RaceContext {
if(raceDefinition != null && raceDefinition.getCourse() != null && trackedRace != null) {
int totalLegsCount = raceDefinition.getCourse().getLegs().size();
int currentLegNo = trackedRace.getLastLegStarted(MillisecondsTimePoint.now());
raceProgress = new RaceProgressDTO(currentLegNo, totalLegsCount);
if (currentLegNo > 0 && totalLegsCount > 0) {
raceProgress = new RaceProgressDTO(currentLegNo, totalLegsCount);
}
}
return raceProgress;
}