@sbhjt-gr/react-native-webrtc 137.0.7 → 137.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -218,9 +218,14 @@ public class WebRTCModule extends ReactContextBaseJavaModule {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
void sendEvent(String eventName, @Nullable ReadableMap params) {
|
|
221
|
-
getReactApplicationContext()
|
|
221
|
+
ReactApplicationContext context = getReactApplicationContext();
|
|
222
|
+
if (!context.hasActiveReactInstance()) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
final ReadableMap payload = params;
|
|
226
|
+
context.runOnJSQueueThread(() -> context
|
|
222
227
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
223
|
-
.emit(eventName,
|
|
228
|
+
.emit(eventName, payload));
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
private PeerConnection.IceServer createIceServer(String url) {
|