mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
fix NPE when a touch event is sent to an unknown Android platform view (#9476)
This commit is contained in:
parent
ebb5b909fb
commit
3390019225
@ -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(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user