Fix border case crash with lone AI winning on turn 0 (#9280)

This commit is contained in:
SomeTroglodyte
2023-04-25 16:22:29 +02:00
committed by GitHub
parent e427d91850
commit a507da9a4a

View File

@ -22,6 +22,10 @@ class VictoryScreenDemographics(
buildDemographicsHeaders()
for (rankLabel in RankLabels.values()) {
if (rankLabel == RankLabels.Value) {
// playerCiv is not necessarily alive nor major, and the `first` below would throw
if (playerCiv.isDefeated() || !playerCiv.isMajorCiv()) continue
}
row()
add(rankLabel.name.toLabel())