Fixes issue where a pending session was messing with the month criteria

od
Laurent 6 years ago
parent d4b39c1f14
commit f72c15c926
  1. 4
      app/src/main/java/net/pokeranalytics/android/model/Criteria.kt

@ -171,8 +171,8 @@ sealed class Criteria(override var uniqueIdentifier: Int) : IntIdentifiable, Row
return when (this) {
is AllMonthsUpToNow -> {
val realm = Realm.getDefaultInstance()
val firstSession = realm.where<Session>().sort("startDate", Sort.ASCENDING).findFirst()
val lastSession = realm.where<Session>().sort("startDate", Sort.DESCENDING).findFirst()
val firstSession = realm.where<Session>().isNotNull("startDate").sort("startDate", Sort.ASCENDING).findFirst()
val lastSession = realm.where<Session>().isNotNull("startDate").sort("startDate", Sort.DESCENDING).findFirst()
realm.close()
val years: ArrayList<Query> = arrayListOf()

Loading…
Cancel
Save