5
0
mirror of https://github.com/AJMicke/KickerELO.git synced 2026-03-11 13:31:02 +01:00

Fix bug in update logic for Stat2vs2View

This commit is contained in:
Anton Micke
2025-06-23 15:40:39 +02:00
committed by AJMicke
parent d5475921ea
commit d3d34077f9

View File

@@ -86,10 +86,10 @@ public class Stat2vs2View extends VerticalLayout {
private void updateGoalDiffs(Spieler s) { private void updateGoalDiffs(Spieler s) {
String text = "Mittlere Tordifferenz hinten: "; String text = "Mittlere Tordifferenz hinten: ";
Float backDiff = repo.avgGoalDiffBack(s); Float backDiff = repo.avgGoalDiffBack(s);
goalDiffBack.setText(backDiff.isNaN() ? text + "-" : text + String.format("%.2f", backDiff)); goalDiffBack.setText(backDiff == null || backDiff.isNaN() ? text + "-" : text + String.format("%.2f", backDiff));
text = "Mittlere Tordifferenz vorne: "; text = "Mittlere Tordifferenz vorne: ";
Float frontDiff = repo.avgGoalDiffFront(s); Float frontDiff = repo.avgGoalDiffFront(s);
goalDiffFront.setText(frontDiff.isNaN() ? text + "-" : text + String.format("%.2f", frontDiff)); goalDiffFront.setText(frontDiff == null || frontDiff.isNaN() ? text + "-" : text + String.format("%.2f", frontDiff));
} }
} }