Merge pull request #329 from nightscout/adrian/fix-crash-no-bg

Fix crash of charts if no bg data exists in mg/dl
This commit is contained in:
Milos Kozak 2021-02-13 11:26:29 +01:00 committed by GitHub
commit 7d80176c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,7 @@ class GraphData(
bgReadingsArray = iobCobCalculatorPlugin.bgReadings bgReadingsArray = iobCobCalculatorPlugin.bgReadings
if (bgReadingsArray?.isEmpty() != false) { if (bgReadingsArray?.isEmpty() != false) {
aapsLogger.debug("No BG data.") aapsLogger.debug("No BG data.")
maxY = 10.0 maxY = if (units == Constants.MGDL) 180.0 else 10.0
minY = 0.0 minY = 0.0
return return
} }