fix groupstage crash

sync_v2
Raz 7 months ago
parent 0db09bc475
commit 29b2ec0124
  1. 9
      PadelClub/Data/GroupStage.swift

@ -458,12 +458,15 @@ final class GroupStage: BaseGroupStage, SideStorable {
var scoreCache: [Int: TeamGroupStageScore] = [:]
func computedScore(forTeam team: TeamRegistration, step: Int = 0) -> TeamGroupStageScore? {
if let cachedScore = scoreCache[team.groupStagePositionAtStep(step)!] {
guard let groupStagePositionAtStep = team.groupStagePositionAtStep(step) else {
return nil
}
if let cachedScore = scoreCache[groupStagePositionAtStep] {
return cachedScore
} else {
let score = _score(forGroupStagePosition: team.groupStagePositionAtStep(step)!)
let score = _score(forGroupStagePosition: groupStagePositionAtStep)
if let score = score {
scoreCache[team.groupStagePositionAtStep(step)!] = score
scoreCache[groupStagePositionAtStep] = score
}
return score
}

Loading…
Cancel
Save