Przeglądaj źródła

try to fix calibration error in first start

fix #92 (hope)
Pierre L 2 lat temu
rodzic
commit
a460a444ae
1 zmienionych plików z 3 dodań i 1 usunięć
  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 {