avoid NPE in case competitor's sail ID isn't found, e.g., for Cam boat

This commit is contained in:
Axel Uhl committed 2012-06-13 14:43:15 +02:00
1 parent 9ffd96f606
commit f47769c81d
1 file changed
+8 -6
@@ -216,12 +216,14 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog<BulkSco
// apply the score correction of the cell:
String raceNameOrNumber = getSelectedString(raceNameOrNumberChoosers, raceColumn);
String officialSailID = getSelectedString(officialSailIDChoosers, competitor);
ScoreCorrectionEntryDTO officialCorrectionEntry =
regattaScoreCorrection.getScoreCorrectionsByRaceNameOrNumber()
.get(raceNameOrNumber).get(officialSailID);
result.addMaxPointsReasonUpdate(competitor, raceColumn, officialCorrectionEntry.getMaxPointsReason());
result.addScoreUpdate(competitor, raceColumn,
(int) Math.round(officialCorrectionEntry.getScore().doubleValue()));
if (officialSailID != null) {
ScoreCorrectionEntryDTO officialCorrectionEntry = regattaScoreCorrection
.getScoreCorrectionsByRaceNameOrNumber().get(raceNameOrNumber).get(officialSailID);
result.addMaxPointsReasonUpdate(competitor, raceColumn,
officialCorrectionEntry.getMaxPointsReason());
result.addScoreUpdate(competitor, raceColumn,
(int) Math.round(officialCorrectionEntry.getScore().doubleValue()));
}
}
}
}