Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Loop/Managers/LoopDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -854,10 +854,14 @@ final class LoopDataManager {
throw LoopError.missingDataError(details: "Glucose", recovery: "Check your CGM data source")
}

guard let pumpStatusDate = doseStore.lastReservoirValue?.startDate else {
self.predictedGlucose = nil
throw LoopError.missingDataError(details: "Reservoir", recovery: "Check that your pump is in range")
}
#if IOS_SIMULATOR
let pumpStatusDate = doseStore.lastReservoirValue?.startDate ?? Date()
#else
guard let pumpStatusDate = doseStore.lastReservoirValue?.startDate else {
self.predictedGlucose = nil
throw LoopError.missingDataError(details: "Reservoir", recovery: "Check that your pump is in range")
}
#endif

let startDate = Date()

Expand Down