浏览代码

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 {