Skip to content

Commit 36161cc

Browse files
committed
fix: android bug fix when touch event could be dispatched after view destroyed
1 parent 864bd66 commit 36161cc

File tree

1 file changed

+5
-3
lines changed
  • plugin/platforms/android/java/com/nativescript/gesturehandler

1 file changed

+5
-3
lines changed

plugin/platforms/android/java/com/nativescript/gesturehandler/PageLayout.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
8686
}
8787

8888
public boolean dispatchTouchEventToOrchestrator(MotionEvent ev) {
89-
this.mPassingTouch = true;
90-
this.mOrchestrator.onTouchEvent(ev);
91-
this.mPassingTouch = false;
89+
if (this.mOrchestrator != null) {
90+
this.mPassingTouch = true;
91+
this.mOrchestrator.onTouchEvent(ev);
92+
this.mPassingTouch = false;
93+
}
9294
// if (GestureHandler.debug) {
9395
// Log.d("JS", "PageLayout dispatchTouchEventToOrchestrator " + this.mShouldIntercept);
9496
// }

0 commit comments

Comments
 (0)