Browse Source

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.
master
Saúl Ibarra Corretgé 6 years ago
parent
commit
103ae363f6
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      ios/sdk/src/callkit/CallKit.m

+ 10
- 0
ios/sdk/src/callkit/CallKit.m View File

324
 
324
 
325
 #endif
325
 #endif
326
 
326
 
327
+// The bridge might already be invalidated by the time a CallKit event is processed,
328
+// just ignore it and don't emit it.
329
+- (void)sendEventWithName:(NSString *)name body:(id)body {
330
+    if (!self.bridge) {
331
+        return;
332
+    }
333
+
334
+    [super sendEventWithName:name body:body];
335
+}
336
+
327
 @end
337
 @end

Loading…
Cancel
Save