Merge pull request #2858 from jbr7rr/dash-crash

Dash: Fix crash in history
This commit is contained in:
Milos Kozak 2023-10-04 13:35:44 +02:00 committed by GitHub
commit f75b4527ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@ package info.nightscout.pump.common.defs
import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.resources.ResourceHelper
import info.nightscout.pump.common.R import info.nightscout.pump.common.R
import kotlin.streams.toList
/** /**
* This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes * This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes
@ -63,17 +62,12 @@ enum class PumpHistoryEntryGroup(val resourceId: Int, val pumpTypeGroupConfig: P
val outList: List<PumpHistoryEntryGroup> val outList: List<PumpHistoryEntryGroup>
if (pumpTypeGroupConfig == PumpTypeGroupConfig.All) { if (pumpTypeGroupConfig == PumpTypeGroupConfig.All) {
outList = translatedList!!.stream() outList = translatedList!!.filter { pre -> pre.pumpTypeGroupConfig == PumpTypeGroupConfig.All }
.filter { pre -> pre.pumpTypeGroupConfig == PumpTypeGroupConfig.All }
.toList()
} else { } else {
outList = translatedList!!.stream() outList = translatedList!!.filter { pre -> (pre.pumpTypeGroupConfig == PumpTypeGroupConfig.All || pre.pumpTypeGroupConfig == pumpTypeGroupConfig) }
.filter { pre -> (pre.pumpTypeGroupConfig == PumpTypeGroupConfig.All || pre.pumpTypeGroupConfig == pumpTypeGroupConfig) }
.toList()
} }
return outList return outList
} }
} }
} }