Fix when no rounds
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
All checks were successful
Gitea/swiss-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -96,12 +96,14 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
|
||||
for (var event : tournament.getEvents()) {
|
||||
if (event.getGroups() != null) {
|
||||
for (var group : event.getGroups()) {
|
||||
for (var round : group.getRounds()) {
|
||||
for (var match : round.getMatches()) {
|
||||
if (match.getStatus() == Status.IN_PROGRESS && match.getCounter() != null) {
|
||||
var counter = getTournamentPlayerFromPlayerId(tournament, match.getCounter().getId());
|
||||
if (counter != null) {
|
||||
playersCounting.add(counter.getId());
|
||||
if (group.getRounds() != null) {
|
||||
for (var round : group.getRounds()) {
|
||||
for (var match : round.getMatches()) {
|
||||
if (match.getStatus() == Status.IN_PROGRESS && match.getCounter() != null) {
|
||||
var counter = getTournamentPlayerFromPlayerId(tournament, match.getCounter().getId());
|
||||
if (counter != null) {
|
||||
playersCounting.add(counter.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,10 +120,12 @@ public class TournamentMapper implements DtoMapper<Tournament, TournamentDto>, E
|
||||
for (var event : tournament.getEvents()) {
|
||||
if (event.getGroups() != null) {
|
||||
for (var group : event.getGroups()) {
|
||||
for (var round : group.getRounds()) {
|
||||
for (var match : round.getMatches()) {
|
||||
if (match.getStatus() == Status.IN_PROGRESS) {
|
||||
playersPlaying.addAll(getPlayersInMatch(tournament, match));
|
||||
if (group.getRounds() != null) {
|
||||
for (var round : group.getRounds()) {
|
||||
for (var match : round.getMatches()) {
|
||||
if (match.getStatus() == Status.IN_PROGRESS) {
|
||||
playersPlaying.addAll(getPlayersInMatch(tournament, match));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user