Fixing bug preventing JSON to be parsed

This commit is contained in:
Simon Pamies committed 2015-06-19 13:21:24 +01:00
1 parent 8ff5aea866
commit a7e3ba15a6
1 file changed
+2 -2
@@ -889,8 +889,8 @@ public class RegattasResource extends AbstractSailingServerResource {
throw re;
}
}
jsonCompetitorInLeg.put("gapToLeader-s",
trackedLegOfCompetitor.getGapToLeader(timePoint, rankingInfo, WindPositionMode.LEG_MIDDLE));
Duration gapToLeaderDuration = trackedLegOfCompetitor.getGapToLeader(timePoint, rankingInfo, WindPositionMode.LEG_MIDDLE);
jsonCompetitorInLeg.put("gapToLeader-s", gapToLeaderDuration != null ? gapToLeaderDuration.asSeconds() : 0.0);
jsonCompetitorInLeg.put("started", trackedLegOfCompetitor.hasStartedLeg(timePoint));
jsonCompetitorInLeg.put("finished", trackedLegOfCompetitor.hasFinishedLeg(timePoint));
jsonCompetitors.add(jsonCompetitorInLeg);