You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test Nightscout site I'm using had no data for 10 days after being previously used with LoopFollow.
LoopFollow began to crash when I started it again and began to populate the NS site with data
the Loop data is uploaded from a test phone
the glucose data is uploaded using a shell script from my computer
(Note that I had quit LoopFollow in the interim, when not testing it.)
Crash
Built LoopFollow with Xcode so I could find the crash:
fatal error index out of range for LoopFollow/Controllers/Alarms.swift, line 246 (lines 245 and 246 shown)
let persistentHighReadings = Int(UserDefaultsRepository.alertHighPersistent.value / 5)
let persistentHighBG = bgData[bgData.count - 1 - persistentHighReadings].sgv
printed out some values:
bgData.count = 6
persistentHighReadings = 12
leading to the index out of range
Bandaid fix
modified line 245 to prevent index out of range. Let it run and there were no more crashes.
let persistentHighReadings = min(Int(UserDefaultsRepository.alertHighPersistent.value / 5), bgData.count-1)
let persistentHighBG = bgData[bgData.count - 1 - persistentHighReadings].sgv
The text was updated successfully, but these errors were encountered:
Scenario
The test Nightscout site I'm using had no data for 10 days after being previously used with LoopFollow.
LoopFollow began to crash when I started it again and began to populate the NS site with data
Crash
Built LoopFollow with Xcode so I could find the crash:
printed out some values:
leading to the index out of range
Bandaid fix
The text was updated successfully, but these errors were encountered: