Skip to content

Commit 426396f

Browse files
authored
Wrap unsafe callback
1 parent dc819f4 commit 426396f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/FlutterWebRTCPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import com.cloudwebrtc.webrtc.record.AudioChannel;
1111
import com.cloudwebrtc.webrtc.record.FrameCapturer;
12+
import com.cloudwebrtc.webrtc.utils.AnyThreadResult;
1213
import com.cloudwebrtc.webrtc.utils.ConstraintsArray;
1314
import com.cloudwebrtc.webrtc.utils.ConstraintsMap;
1415
import com.cloudwebrtc.webrtc.utils.EglUtils;
@@ -124,7 +125,8 @@ private FlutterWebRTCPlugin(Registrar registrar, MethodChannel channel) {
124125
}
125126

126127
@Override
127-
public void onMethodCall(MethodCall call, Result result) {
128+
public void onMethodCall(MethodCall call, Result notSafeResult) {
129+
final AnyThreadResult result = new AnyThreadResult(notSafeResult);
128130
if (call.method.equals("createPeerConnection")) {
129131
Map<String, Object> constraints = call.argument("constraints");
130132
Map<String, Object> configuration = call.argument("configuration");

0 commit comments

Comments
 (0)