-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpectedly found nil while unwrapping an Optional value #497
Comments
I can reproduce reliably by clicking cancel after arriving on the pod setup dialog. |
Logs from Xcode when clicking on Cancel: 2019-03-07 18:58:44.447840+0100 RileyLink[14016:2864356] [RileyLinkDeviceManager] centralManagerDidUpdateState: Powered On Logs for when you click on Pair are the same. |
I've took a shot at looking into this. It looks like nil is returned on the OmnipodPumpManager which is Force unwrapped here: Could it be that the OmnipodPumpManager cannot be loaded into the pumpManager variable? @ps2 do you have any pointers or an example if I am on the right track or where I could look further or maybe a similar example of the Medtronic loading of the pumpmanager? |
The hosting nav controller should be passing the pump manager to its viewcontrollers. |
Is there a fix for this? |
@jasoncalabrese Not yet, The nil is returned because the omnipod pairing storyboard in xcode has a page before the pairing steps are starting to setup a basal schedule. In our Loop test setup this route is correctly shown the first time setting it up, but in rileylink_ios this page is apparently ignored on the first run resulting in a nil basal schedule. I do not have worked enough with storyboards yet to know how to reroute this in a proper way. |
When using the omnipod-testing branch the above error is being shown when I run RileyLink on my iPhone via xcode. The error is being shown when I click on cancel or pair in the Pod Pairing screen.
The errors are being raised from the functions cancelButtonPressed() and pair() in OmniKitUI/ViewControllers/PairPodSetupViewController.swift when the pumpManager is being used.
I'm new to swift, but I did notice that pumpManager is still nil when the getPodState or pairAndPrime methods are called.
The text was updated successfully, but these errors were encountered: