diff --git a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt b/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt index d4d5c85b..6ec84ade 100644 --- a/app/src/main/java/net/pokeranalytics/android/model/realm/handhistory/HandHistory.kt +++ b/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 + } } } \ No newline at end of file