avoid a NPE in case of uninitialized race start time in RaceBoardPanel

Change-Id: I911a2b97ffe9c2f24acdc7197fb8f1a0e5266a28
This commit is contained in:
Axel Uhl committed 2016-08-09 19:08:23 +02:00
1 parent c505faa759
commit fc49b29d29
1 file changed
+6 -2
@@ -1,6 +1,7 @@
package com.sap.sailing.gwt.ui.raceboard;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -570,10 +571,13 @@ public class RaceBoardPanel extends AbstractPerspectiveComposite<RaceBoardPerspe
}
private Label computeRaceInformation(RaceColumnDTO raceColumn, FleetDTO fleet) {
final Date startDate = raceColumn.getStartDate(fleet);
Label raceInformationLabel = new Label();
raceInformationLabel.setStyleName("Race-Time-Label");
DateTimeFormat formatter = DateTimeFormat.getFormat("E d/M/y");
raceInformationLabel.setText(formatter.format(raceColumn.getStartDate(fleet)));
if (startDate != null) {
DateTimeFormat formatter = DateTimeFormat.getFormat("E d/M/y");
raceInformationLabel.setText(formatter.format(startDate));
}
return raceInformationLabel;
}