Skip to content

Commit 4c57840

Browse files
committed
fix(android): NPE fix
1 parent 6537d71 commit 4c57840

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugin/platforms/android/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ private static boolean tryIntercept(View view, MotionEvent event) {
129129

130130
@Override
131131
protected void onCancel() {
132-
132+
View view = getView();
133+
if (view == null) {
134+
return;
135+
}
133136
if (GestureHandler.debug) {
134-
Log.d("JS", "NativeViewGestureHandler onCancel " + getView());
137+
Log.d("JS", "NativeViewGestureHandler onCancel " + view);
135138
}
136139
long time = SystemClock.uptimeMillis();
137140
MotionEvent event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0, 0, 0);

0 commit comments

Comments
 (0)