Good morning.
I'm writing this post because I really need some help in facing this issue.
This bug started happening on iOS15.
I'm using CocoaPods as package manager.
At first this could seem a trivial question, because the error message is really clear:
Unexpectedly found nil while unwrapping an Optional value... but it isn't (below more details).
The terminating reason is always SIGNAL 5 Trace/BPT trap: 5.
All of them report that the offending line is the same, and here's the piece of code that causes the crash:
if isToShowRealTime {
sessionComputedData = sessionComputedDataPrv
sessionStatus = session!.sessionStatus // OFFENDING LINE
} else {
// Other code...
}
Yes, this is an unconditional unwrapping, but I am certainly sure that this variable is not nil, because, (to be short) it has the same lifetime of the presenting view controller.
It is set to nil only when the view controller is dismissed (programmatically). So if the view controller is existing also the variable is.
Here are attached some crash reports, but there are many more saying the same thing.
I can't understand why this variable is nil at that time.
Please, could you help me? Many thanks