mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
avoid NPE in case competitor's sail ID isn't found, e.g., for Cam boat
This commit is contained in:
1 parent
9ffd96f606
commit
f47769c81d
1 file changed
+8
-6
+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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user