ios: fix CallKit crash in development mode

It's possible a CallKit event arrives when the React Bridge has been torn down
and there is an assert that checks this. In order to avoid a crash, just skip
the event.
This commit is contained in:
Saúl Ibarra Corretgé 2019-05-08 10:59:56 +02:00 committed by Saúl Ibarra Corretgé
parent 9bde673397
commit 103ae363f6
1 changed files with 10 additions and 0 deletions

View File

@ -324,4 +324,14 @@ RCT_EXPORT_METHOD(updateCall:(NSString *)callUUID
#endif
// The bridge might already be invalidated by the time a CallKit event is processed,
// just ignore it and don't emit it.
- (void)sendEventWithName:(NSString *)name body:(id)body {
if (!self.bridge) {
return;
}
[super sendEventWithName:name body:body];
}
@end