Fix when no rounds
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good

This commit is contained in:
Michel ten Voorde
2025-10-27 14:41:10 +01:00
parent cca133d67c
commit 180d431f8d

View File

@@ -96,6 +96,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
for (var event : tournament.getEvents()) {
if (event.getGroups() != null) {
for (var group : event.getGroups()) {
if (group.getRounds() != null) {
for (var round : group.getRounds()) {
for (var match : round.getMatches()) {
if (match.getStatus() == Status.IN_PROGRESS && match.getCounter() != null) {
@@ -109,6 +110,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
}
}
}
}
return playersCounting;
}
@@ -118,6 +120,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
for (var event : tournament.getEvents()) {
if (event.getGroups() != null) {
for (var group : event.getGroups()) {
if (group.getRounds() != null) {
for (var round : group.getRounds()) {
for (var match : round.getMatches()) {
if (match.getStatus() == Status.IN_PROGRESS) {
@@ -128,6 +131,7 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
}
}
}
}
return playersPlaying;
}