Add test to avoid crash for limit

feature/top10
Aurelien Hubert 7 years ago
parent 0f797c26bf
commit a41933d2f7
  1. 2
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -416,8 +416,10 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre
fun getGameTitle(): String { fun getGameTitle(): String {
var gameTitle = "" var gameTitle = ""
limit?.let { limit?.let {
if (it >= 0 && it < Limit.values().size) {
gameTitle += Limit.values()[it].shortName + " " gameTitle += Limit.values()[it].shortName + " "
} }
}
if (game != null) { if (game != null) {
gameTitle += game?.name gameTitle += game?.name
} }

Loading…
Cancel
Save