Ver código fonte

Merge pull request #1100 from nightscout/fix-tidepool-crash

Fix crash in TidepoolManager
Deniz Cengiz 1 mês atrás
pai
commit
2e69df6f5f

+ 2 - 1
Trio/Sources/Services/Network/TidepoolManager.swift

@@ -320,11 +320,12 @@ extension BaseTidepoolManager {
                                     .processTempBasalEvent(event, existingTempBasalEntries: existingTempBasalEntries)
                             )
                     case .bolus:
+                        guard let amount = event.amount else { return result }
                         let bolusDoseEntry = DoseEntry(
                             type: .bolus,
                             startDate: event.timestamp,
                             endDate: event.timestamp,
-                            value: Double(event.amount!),
+                            value: Double(amount),
                             unit: .units,
                             deliveredUnits: nil,
                             syncIdentifier: event.id,