Procházet zdrojové kódy

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é před 6 roky
rodič
revize
103ae363f6
1 změnil soubory, kde provedl 10 přidání a 0 odebrání
  1. 10
    0
      ios/sdk/src/callkit/CallKit.m

+ 10
- 0
ios/sdk/src/callkit/CallKit.m Zobrazit soubor

@@ -324,4 +324,14 @@ RCT_EXPORT_METHOD(updateCall:(NSString *)callUUID
324 324
 
325 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 337
 @end

Načítá se…
Zrušit
Uložit