Changed winner access in statistics view
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m9s
Pull Request Pipeline / lint (pull_request) Successful in 2m10s

This commit is contained in:
2025-11-23 00:17:48 +01:00
parent 338f4294dc
commit 82b344a145

View File

@@ -127,13 +127,13 @@ class _StatisticsViewState extends State<StatisticsView> {
// Getting the winners
for (var game in games) {
final winner = game.winner;
if (winner != null && winner.isNotEmpty) {
final index = winCounts.indexWhere((entry) => entry.$1 == winner);
if (winner != null) {
final index = winCounts.indexWhere((entry) => entry.$1 == winner.id);
if (index != -1) {
final current = winCounts[index].$2;
winCounts[index] = (winner, current + 1);
winCounts[index] = (winner.id, current + 1);
} else {
winCounts.add((winner, 1));
winCounts.add((winner.id, 1));
}
}
}