Fix crash of charts if no bg data exists in mg/dl

This commit is contained in:
AdrianLxM 2021-02-13 01:38:43 +01:00 committed by GitHub
parent d1ba6dda73
commit ab9c533ff3
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
} }