Fixes a crash when setting straddle then changing the number of players

kmm_hh
Laurent 5 years ago
parent 03361961b5
commit 886c4095d5
  1. 6
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/model/EditorViewModel.kt

@ -423,6 +423,12 @@ class EditorViewModel : ViewModel(), RowRepresentableDataSource, CardCentralizer
if (playerCount != this.handHistory.numberOfPlayers) {
this.clearSelection() // avoid crashes
this.handSetup.tableSize = playerCount
if (this.handSetup.straddlePositions.isNotEmpty()) { // avoid possible crashes
this.handSetup.clearStraddles()
this.straddlePositions.clear()
}
this.handHistory.configure(this.handSetup)
load()
}

Loading…
Cancel
Save