Преглед изворни кода

try to fix calibration error in first start

fix #92 (hope)
Pierre L пре 2 година
родитељ
комит
a460a444ae
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      FreeAPS/Sources/APS/FetchGlucoseManager.swift

+ 3 - 1
FreeAPS/Sources/APS/FetchGlucoseManager.swift

@@ -298,7 +298,9 @@ final class BaseFetchGlucoseManager: FetchGlucoseManager, Injectable {
         // overcalibrate
         var overcalibration: ((Int) -> (Double))?
         processQueue.sync {
-            overcalibration = calibrationService.calibrate
+            if let cal = calibrationService {
+                overcalibration = cal.calibrate
+            }
         }
 
         if let overcalibration = overcalibration {