realmasync
Laurent 2 years ago
parent 548d8b6acc
commit ab9b7724c1
  1. 8
      app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt

@ -754,9 +754,13 @@ open class HandHistory : RealmObject(), Deletable, RowRepresentable, Filterable,
return cards.filter { it.isSuitWildCard }
}
val largestWonPot: WonPot?
private val largestWonPot: WonPot?
get() {
return this.winnerPots.maxBy { it.amount }
return if (this.winnerPots.isNotEmpty()) { // needed, otherwise maxBy crashes
this.winnerPots.maxBy { it.amount }
} else {
null
}
}
}
Loading…
Cancel
Save