Fix a potential NPE in recomputeDUDD
This commit is contained in:
@@ -95,11 +95,13 @@ sealed class Tournament <P: Pairable>(
|
|||||||
// Instantiate solver with game history
|
// Instantiate solver with game history
|
||||||
val solver = pairing.solver(this, round, pairables.values.toList())
|
val solver = pairing.solver(this, round, pairables.values.toList())
|
||||||
for (game in games(round).values) {
|
for (game in games(round).values) {
|
||||||
|
if (game.black != 0 && game.white != 0) {
|
||||||
val white = solver.pairables.find { p-> p.id == game.white }!!
|
val white = solver.pairables.find { p-> p.id == game.white }!!
|
||||||
val black = solver.pairables.find { p-> p.id == game.black }!!
|
val black = solver.pairables.find { p-> p.id == game.black }!!
|
||||||
game.drawnUpDown = solver.dudd(black, white)
|
game.drawnUpDown = solver.dudd(black, white)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user