未验证 提交 33900192 编写于 作者: A Amir Hardon 提交者: GitHub

fix NPE when a touch event is sent to an unknown Android platform view (#9476)

上级 ebb5b909
......@@ -192,11 +192,10 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega
parsePointerCoordsList(touch.rawPointerCoords, density)
.toArray(new PointerCoords[touch.pointerCount]);
View view = vdControllers.get(touch.viewId).getView();
if (view == null) {
throw new IllegalStateException("Sending touch to an unknown view with id: "
+ touch.viewId);
if (!vdControllers.containsKey(touch.viewId)) {
throw new IllegalStateException("Sending touch to an unknown view with id: " + touch.viewId);
}
View view = vdControllers.get(touch.viewId).getView();
MotionEvent event = MotionEvent.obtain(
touch.downTime.longValue(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册