Skip to content

Commit

Permalink
fix NPE when a touch event is sent to an unknown Android platform view (
Browse files Browse the repository at this point in the history
  • Loading branch information
amirh authored Jun 25, 2019
1 parent ebb5b90 commit 3390019
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,10 @@ public void onTouch(@NonNull PlatformViewsChannel.PlatformViewTouch touch) {
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(),
Expand Down

0 comments on commit 3390019

Please sign in to comment.