Fix crash when array is null

feature/top10
Aurelien Hubert 7 years ago
parent 7476af5e6c
commit 49d20f41fa
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/utils/FavoriteSessionFinder.kt

@ -68,7 +68,7 @@ class FavoriteSessionFinder {
companion object { companion object {
private val FAVORITE_SIGNIFICANT_SESSIONS = 15L private const val FAVORITE_SIGNIFICANT_SESSIONS = 15L
/** /**
* Copies the favorite session parameters on the [newSession] * Copies the favorite session parameters on the [newSession]
@ -94,7 +94,6 @@ class FavoriteSessionFinder {
} }
} }
} }
} }
/** /**
@ -123,7 +122,7 @@ class FavoriteSessionFinder {
} }
val sortedCounters = counters.values.sortedBy { it.counter } val sortedCounters = counters.values.sortedBy { it.counter }
return sortedCounters.first().session return sortedCounters.firstOrNull()?.session
} }
} }

Loading…
Cancel
Save