Explorar o código

Fix: null bolus, manual care portal entry

Jon Fawcett %!s(int64=5) %!d(string=hai) anos
pai
achega
ea2ffc130d
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  1. 2 7
      LoopFollow/Controllers/NightScout.swift

+ 2 - 7
LoopFollow/Controllers/NightScout.swift

@@ -1358,8 +1358,8 @@ extension MainViewController {
             dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
             let dateString = dateFormatter.date(from: strippedZone)
             let dateTimeStamp = dateString!.timeIntervalSince1970
-            do {
-                let bolus = try currentEntry?["insulin"] as! Double
+
+                guard let bolus = currentEntry?["insulin"] as? Double else { continue }
                 let sgv = findNearestBGbyTime(needle: dateTimeStamp, haystack: bgData, startingIndex: lastFoundIndex)
                 lastFoundIndex = sgv.foundIndex
                 
@@ -1368,11 +1368,6 @@ extension MainViewController {
                     let dot = bolusGraphStruct(value: bolus, date: Double(dateTimeStamp), sgv: Int(sgv.sgv + 20))
                     bolusData.append(dot)
                 }
-            } catch {
-                if UserDefaultsRepository.debugLog.value { self.writeDebugLog(value: "ERROR: Null Bolus") }
-            }
-            
-           
             
         }