Fixing crash and bug

feature/top10
Laurent 7 years ago
parent f5b9190583
commit fba9968a10
  1. 11
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -800,7 +800,9 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat
game = null game = null
} }
} }
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee = if (value == null) null else (value as String).toDouble() SessionRow.INITIAL_BUY_IN -> {
this.tournamentEntryFee = (value as Double?)
}
SessionRow.LOCATION -> location = value as Location? SessionRow.LOCATION -> location = value as Location?
SessionRow.PLAYERS -> { SessionRow.PLAYERS -> {
if (value is Double) { if (value is Double) {
@ -829,9 +831,14 @@ open class Session : RealmObject(), Savable, Editable, StaticRowRepresentableDat
} }
SessionRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName? SessionRow.TOURNAMENT_NAME -> tournamentName = value as TournamentName?
SessionRow.TOURNAMENT_TYPE -> tournamentType = value as Int? SessionRow.TOURNAMENT_TYPE -> tournamentType = value as Int?
SessionRow.TOURNAMENT_FEATURE -> value?.let { SessionRow.TOURNAMENT_FEATURE -> {
value?.let {
tournamentFeatures = RealmList() tournamentFeatures = RealmList()
tournamentFeatures.addAll((it as ArrayList<TournamentFeature>)) tournamentFeatures.addAll((it as ArrayList<TournamentFeature>))
} ?: run {
tournamentFeatures.removeAll(this.tournamentFeatures)
}
} }
} }
} }

Loading…
Cancel
Save