Getting a strange crash fairly commonly among iPhones sending data between each other over bluetooth. After a lot of effort I still cannot reproduce it in the debugger.
Crash log:
NSInternalInconsistencyException
Invalid parameter not satisfying: request != nil
3 Foundation 0x0000000186d28ed4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 108
4 CoreBluetooth 0x0000000185aec808 -[CBPeripheralManager respondToRequest:withResult:] + 156
5 CoreBluetooth 0x0000000185aee410 -[CBPeripheralManager handleSetAttributeValues:] + 1104
Don't know what triggers the peripheral manager to call handleSetAttributeValues or where the nil value is coming from here.
There is only one place in the codebase where I call [CBPeripheralManager respondToRequest:withResult:] and I have safeguards around it to ensure that it will never get called if request is nil.