Do not send messages if the platform view has been detached (flutter/engine#3927)

This commit is contained in:
Jason Simmons
2017-07-26 20:04:31 -07:00
committed by GitHub
parent 4ab42e4358
commit dc5ae3c20f

View File

@@ -816,6 +816,11 @@ public class FlutterView extends SurfaceView
@Override
public void send(String channel, ByteBuffer message, BinaryReply callback) {
if (!isAttached()) {
Log.d("flutter", "FlutterView.send called on a detached view, channel=" + channel);
return;
}
int replyId = 0;
if (callback != null) {
replyId = mNextReplyId++;